Documentation
¶
Index ¶
- func Diskfree(drive string, freeBytesAvailable *uint64) error
- func LocalMountPoint(loc path.Local) (string, error)
- func OnUnix() bool
- func OnWindows() bool
- type FS
- func (d *FS) Delete(p path.Relative, recursive bool) (err error)
- func (d *FS) Drive(p path.Relative) (path.Local, error)
- func (d *FS) FreeSpace(p path.Relative) int64
- func (d *FS) Move(src path.Relative, trgDir path.Relative) error
- func (d *FS) Rename(old path.Relative, newName string) error
- func (d *FS) SetMode(name path.Relative, m fs.FileMode) error
- func (d *FS) Write(name path.Relative, data io.ReadCloser, recursive bool) error
- func (d *FS) WriteWithMode(p path.Relative, rd io.ReadCloser, perm fs.FileMode, recursive bool) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FS ¶
func (*FS) Move ¶
Move should return an error, if - the src does not exist - src is a directory and moving of directories is not supported by the fs - the resulting path trgDir.Join(path.Name(src)) does already exist - src and trgdir have different mountpoints
func (*FS) Rename ¶
Rename renames a file RenameFile renames a file. It is not allowed for directories and will also not move files, if the target is a directory. Renaming will fail, if there exists already a file under this name. Renaming will also fail, if the new file path is in a different directory should fail when the new name is not a name but a path
func (*FS) WriteWithMode ¶
func (d *FS) WriteWithMode(p path.Relative, rd io.ReadCloser, perm fs.FileMode, recursive bool) (err error)
WriteWithMode reads from the given reader and writes all the content to the file of the given path. If the file already exists, if will be overwritten. Otherwise the file is newly created If name is a directory, data is ignored and the directory is created. If the directory is already there, nothing happens