Documentation ¶
Index ¶
- Constants
- Variables
- func DecomposesUnicode(path string) (bool, error)
- func DeviceID(path string) (uint64, error)
- func DirectoryContents(path string) ([]string, error)
- func GetOwnership(info os.FileInfo) (int, int, error)
- func Mutagen(create bool, subpath ...string) (string, error)
- func Normalize(path string) (string, error)
- func PreservesExecutability(path string) (bool, error)
- func RenameFileAtomic(oldPath, newPath string) error
- func SetOwnership(path string, uid, gid int) error
- func Watch(context context.Context, root string, events chan struct{}, mode WatchMode, ...)
- func WriteFileAtomic(path string, data []byte, permissions os.FileMode) error
- type Locker
- type WatchMode
Constants ¶
const (
// DefaultPollingInterval is the default watch polling interval, in seconds.
DefaultPollingInterval = 10
)
const ( // MutagenDirectoryName is the name of the Mutagen control directory inside // the user's home directory. MutagenDirectoryName = ".mutagen" )
Variables ¶
var HomeDirectory string
HomeDirectory is the cached path to the current user's home directory.
var MutagenConfigurationPath string
MutagenConfigurationPath is the path to the Mutagen configuration file.
var WatchMode_name = map[int32]string{
0: "WatchDefault",
1: "WatchPortable",
2: "WatchForcePoll",
}
var WatchMode_value = map[string]int32{
"WatchDefault": 0,
"WatchPortable": 1,
"WatchForcePoll": 2,
}
Functions ¶
func DecomposesUnicode ¶
func DirectoryContents ¶
func PreservesExecutability ¶
func RenameFileAtomic ¶
RenameFileAtomic performs an atomic file rename. In the simplest case, it's a simple alias for os.Rename. However, if moving a file across filesystems, it will fall back to a copy/rename combination that should still approximate atomicity (at least in terms of swapping the destination file contents). It does NOT support renaming directories, only files. It takes inspiration from: https://github.com/golang/dep/blob/4ad9f4ec24012607dc247ca24528e3224d61519a/fs.go#L80
func SetOwnership ¶
func Watch ¶
func Watch(context context.Context, root string, events chan struct{}, mode WatchMode, pollInterval uint32)
TODO: Document that this function closes the events channel when the watch is cancelled. TODO: Document that this function will always succeed in one way or another (it doesn't have any total failure modes) and won't exit until the associated context is cancelled. TODO: Document that the events channel must be buffered.
Types ¶
type WatchMode ¶
type WatchMode int32
WatchMode specifies the mode for filesystem watching.
const ( // WatchMode_WatchDefault represents an unspecified watch mode. It should be // converted to one of the following values based on the desired default // behavior. WatchMode_WatchDefault WatchMode = 0 // WatchMode_WatchPortable specifies that native recursive watching should // be used to monitor paths on systems that support it if those paths fall // under the home directory. In these cases, a watch on the entire home // directory is established and filtered for events pertaining to the // specified path. On all other systems and for all other paths, poll-based // watching is used. WatchMode_WatchPortable WatchMode = 1 // WatchMode_WatchForcePoll specifies that only poll-based watching should // be used. WatchMode_WatchForcePoll WatchMode = 2 )
func (WatchMode) Description ¶
Description returns a human-readable description of a watch mode.
func (WatchMode) EnumDescriptor ¶
func (WatchMode) Supported ¶
Supported indicates whether or not a particular watch mode is a valid, non-default value.
func (*WatchMode) UnmarshalText ¶
UnmarshalText implements the text unmarshalling interface used when loading from TOML files.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package winfsnotify allows the user to receive file system event notifications on Windows.
|
Package winfsnotify allows the user to receive file system event notifications on Windows. |