Documentation ¶
Index ¶
- func HardLinkFiles(srcDir, dstDir string) error
- func IsDirOrSymlink(fi os.FileInfo) bool
- func IsPathExist(path string) bool
- func MkdirAllFailIfExist(path string) error
- func MkdirAllIfNotExist(path string) error
- func MustClose(f *os.File)
- func MustRemoveAll(path string)
- func MustSyncPath(path string)
- func MustWriteData(w io.Writer, data []byte)
- func ReadFullData(r io.Reader, data []byte) error
- func RemoveDirContents(dir string)
- func SymlinkRelative(srcPath, dstPath string) error
- func WriteFile(path string, data []byte) error
- type ReadAtCloser
- type ReaderAt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HardLinkFiles ¶
HardLinkFiles makes hard links for all the files from srcDir in dstDir.
func IsDirOrSymlink ¶
IsDirOrSymlink returns true if fi is directory or symlink.
func IsPathExist ¶
IsPathExist returns whether the given path exists.
func MkdirAllFailIfExist ¶
MkdirAllFailIfExist creates the given path dir if it isn't exist.
Returns error if path already exists.
func MkdirAllIfNotExist ¶
MkdirAllIfNotExist creates the given path dir if it isn't exist.
func MustRemoveAll ¶ added in v1.19.0
func MustRemoveAll(path string)
MustRemoveAll removes path with all the contents.
It properly handles NFS issue https://github.com/VictoriaMetrics/VictoriaMetrics/issues/61 .
func MustSyncPath ¶ added in v1.19.2
func MustSyncPath(path string)
MustSyncPath syncs contents of the given path.
func ReadFullData ¶
ReadFullData reads len(data) bytes from r.
func RemoveDirContents ¶
func RemoveDirContents(dir string)
RemoveDirContents removes all the contents of the given dir it it exists.
It doesn't remove the dir itself, so the dir may be mounted to a separate partition.
func SymlinkRelative ¶
SymlinkRelative creates relative symlink for srcPath in dstPath.
Types ¶
type ReadAtCloser ¶
type ReadAtCloser interface { // ReadAt must read len(p) bytes from offset off to p. ReadAt(p []byte, off int64) // MustClose must close the reader. MustClose() }
ReadAtCloser is rand-access read interface.
type ReaderAt ¶
type ReaderAt struct {
// contains filtered or unexported fields
}
ReaderAt implements rand-access read.
func OpenReaderAt ¶
OpenReaderAt opens a file on the given path for random-read access.
The file must be closed with MustClose when no longer needed.