package fileutil
import "github.com/coreos/etcd/pkg/fileutil"
Index ¶
- Variables
- func IsDirWriteable(dir string) error
- func Preallocate(f *os.File, sizeInBytes int) error
- func PurgeFile(dirname string, suffix string, max uint, interval time.Duration, stop <-chan struct{}) <-chan error
- func ReadDir(dirpath string) ([]string, error)
- func TouchDirAll(dir string) error
- type Lock
Variables ¶
Functions ¶
func IsDirWriteable ¶
IsDirWriteable checks if dir is writable by writing and removing a file to dir. It returns nil if dir is writable.
func Preallocate ¶
Preallocate tries to allocate the space for given file. This operation is only supported on linux by a few filesystems (btrfs, ext4, etc.). If the operation is unsupported, no error will be returned. Otherwise, the error encountered will be returned.
func PurgeFile ¶
func PurgeFile(dirname string, suffix string, max uint, interval time.Duration, stop <-chan struct{}) <-chan error
func ReadDir ¶
ReadDir returns the filenames in the given directory in sorted order.
func TouchDirAll ¶
TouchDirAll is simliar to os.MkdirAll. It creates directories with 0700 permission if any directory does not exists. TouchDirAll also ensures the given directory is writable.
Types ¶
type Lock ¶
func NewLock ¶
Source Files ¶
fileutil.go lock_unix.go perallocate_unsupported.go purge.go
- Version
- v2.2.5+incompatible
- Published
- Feb 1, 2016
- Platform
- js/wasm
- Imports
- 9 packages
- Last checked
- 1 hour ago –
Tools for package owners.