Documentation
¶
Overview ¶
Package fsmount provides functionality to mount a Files.com file system using FUSE.
Index ¶
- Constants
- Variables
- type FSWriter
- type Filescomfs
- func (fs *Filescomfs) Access(path string, mask uint32) (errc int)
- func (fs *Filescomfs) Chflags(path string, flags uint32) (errc int)
- func (fs *Filescomfs) Chmod(path string, mode uint32) (errc int)
- func (fs *Filescomfs) Chown(path string, uid uint32, gid uint32) (errc int)
- func (fs *Filescomfs) Create(path string, flags int, mode uint32) (errc int, fh uint64)
- func (fs *Filescomfs) CreateEx(path string, mode uint32, fi *fuse.FileInfo_t) (errc int)
- func (fs *Filescomfs) Destroy()
- func (fs *Filescomfs) Flush(path string, fh uint64) (errc int)
- func (fs *Filescomfs) Fsync(path string, datasync bool, fh uint64) (errc int)
- func (fs *Filescomfs) Fsyncdir(path string, datasync bool, fh uint64) (errc int)
- func (fs *Filescomfs) Getattr(path string, stat *fuse.Stat_t, fh uint64) (errc int)
- func (fs *Filescomfs) Getpath(path string, fh uint64) (errc int, result string)
- func (fs *Filescomfs) Getxattr(path string, name string) (errc int, value []byte)
- func (fs *Filescomfs) Init()
- func (fs *Filescomfs) Link(oldpath string, newpath string) (errc int)
- func (fs *Filescomfs) Listxattr(path string, fill func(name string) bool) (errc int)
- func (fs *Filescomfs) Mkdir(path string, mode uint32) (errc int)
- func (fs *Filescomfs) Mknod(path string, mode uint32, dev uint64) (errc int)
- func (fs *Filescomfs) Open(path string, flags int) (errc int, fh uint64)
- func (fs *Filescomfs) OpenEx(path string, fi *fuse.FileInfo_t) (errc int)
- func (fs *Filescomfs) Opendir(path string) (errc int, fh uint64)
- func (fs *Filescomfs) Read(path string, buff []byte, ofst int64, fh uint64) (n int)
- func (fs *Filescomfs) Readdir(path string, fill func(name string, stat *fuse.Stat_t, ofst int64) bool, ...) (errc int)
- func (fs *Filescomfs) Readlink(path string) (errc int, target string)
- func (fs *Filescomfs) Release(path string, fh uint64) (errc int)
- func (fs *Filescomfs) Releasedir(path string, fh uint64) (errc int)
- func (fs *Filescomfs) Removexattr(path string, name string) (errc int)
- func (fs *Filescomfs) Rename(oldpath string, newpath string) (errc int)
- func (fs *Filescomfs) Rmdir(path string) int
- func (fs *Filescomfs) Setchgtime(path string, tmsp fuse.Timespec) (errc int)
- func (fs *Filescomfs) Setcrtime(path string, tmsp fuse.Timespec) (errc int)
- func (fs *Filescomfs) Setxattr(path string, name string, value []byte, flags int) (errc int)
- func (fs *Filescomfs) Statfs(path string, stat *fuse.Statfs_t) (errc int)
- func (fs *Filescomfs) Symlink(target string, newpath string) (errc int)
- func (fs *Filescomfs) Truncate(path string, size int64, fh uint64) (errc int)
- func (fs *Filescomfs) Unlink(path string) (errc int)
- func (fs *Filescomfs) Utimens(path string, tmsp []fuse.Timespec) (errc int)
- func (fs *Filescomfs) Validate() error
- func (fs *Filescomfs) Write(path string, buff []byte, ofst int64, fh uint64) (n int)
- type FuseFlags
- func (f FuseFlags) IsAppend() bool
- func (f FuseFlags) IsCreate() bool
- func (f FuseFlags) IsCreateExclusive() bool
- func (f FuseFlags) IsEventOnly() bool
- func (f FuseFlags) IsExclusive() bool
- func (f FuseFlags) IsReadOnly() bool
- func (f FuseFlags) IsReadWrite() bool
- func (f FuseFlags) IsTruncate() bool
- func (f FuseFlags) IsWriteOnly() bool
- func (f FuseFlags) String() string
- func (f FuseFlags) Without(remove int) FuseFlags
- type Host
- type LocalFs
- func (fs *LocalFs) Access(path string, mask uint32) int
- func (fs *LocalFs) Chflags(path string, flags uint32) int
- func (fs *LocalFs) Chmod(path string, mode uint32) int
- func (fs *LocalFs) Chown(path string, uid uint32, gid uint32) int
- func (fs *LocalFs) Create(path string, flags int, mode uint32) (errc int, fh uint64)
- func (fs *LocalFs) CreateEx(path string, mode uint32, fi *fuse.FileInfo_t) int
- func (fs *LocalFs) Destroy()
- func (fs *LocalFs) Flush(path string, fh uint64) int
- func (fs *LocalFs) Fsync(path string, datasync bool, fh uint64) (errc int)
- func (fs *LocalFs) Fsyncdir(path string, datasync bool, fh uint64) int
- func (fs *LocalFs) Getattr(path string, stat *fuse.Stat_t, fh uint64) (errc int)
- func (fs *LocalFs) Getpath(path string, fh uint64) (int, string)
- func (fs *LocalFs) Getxattr(path string, name string) (int, []byte)
- func (fs *LocalFs) Init()
- func (fs *LocalFs) Link(oldpath string, newpath string) int
- func (fs *LocalFs) Listxattr(path string, fill func(name string) bool) int
- func (fs *LocalFs) Mkdir(path string, mode uint32) (errc int)
- func (fs *LocalFs) Mknod(path string, mode uint32, dev uint64) int
- func (fs *LocalFs) Open(path string, flags int) (errc int, fh uint64)
- func (fs *LocalFs) OpenEx(path string, fi *fuse.FileInfo_t) int
- func (fs *LocalFs) Opendir(path string) (errc int, fh uint64)
- func (fs *LocalFs) Read(path string, buff []byte, ofst int64, fh uint64) (n int)
- func (fs *LocalFs) Readdir(path string, fill func(name string, stat *fuse.Stat_t, ofst int64) bool, ...) (errc int)
- func (fs *LocalFs) Readlink(path string) (int, string)
- func (fs *LocalFs) Release(path string, fh uint64) (errc int)
- func (fs *LocalFs) Releasedir(path string, fh uint64) (errc int)
- func (fs *LocalFs) Removexattr(path string, name string) int
- func (fs *LocalFs) Rename(oldpath string, newpath string) (errc int)
- func (fs *LocalFs) Rmdir(path string) (errc int)
- func (fs *LocalFs) Setchgtime(path string, tmsp fuse.Timespec) int
- func (fs *LocalFs) Setcrtime(path string, tmsp fuse.Timespec) int
- func (fs *LocalFs) Setxattr(path string, name string, value []byte, flags int) int
- func (fs *LocalFs) Symlink(target string, newpath string) int
- func (fs *LocalFs) Truncate(path string, size int64, fh uint64) (errc int)
- func (fs *LocalFs) Unlink(path string) (errc int)
- func (fs *LocalFs) Utimens(path string, tmsp []fuse.Timespec) (errc int)
- func (fs *LocalFs) Validate() error
- func (fs *LocalFs) Write(path string, buff []byte, ofst int64, fh uint64) (n int)
- type MountParams
- type OpenHandles
- func (h *OpenHandles) Close()
- func (h *OpenHandles) ExtendOpenHandleTtls()
- func (h *OpenHandles) Lookup(id uint64) (*fileHandle, *fsNode, bool)
- func (h *OpenHandles) Open(node *fsNode, flags FuseFlags) (id uint64, fh *fileHandle)
- func (h *OpenHandles) OpenHandles() []*fileHandle
- func (h *OpenHandles) OpenWithFile(node *fsNode, flags FuseFlags, file *os.File) (id uint64, fh *fileHandle)
- func (h *OpenHandles) Release(id uint64) (*fileHandle, bool)
- type RemoteFs
- func (fs *RemoteFs) Access(path string, mask uint32) int
- func (fs *RemoteFs) Chflags(path string, flags uint32) int
- func (fs *RemoteFs) Chmod(path string, mode uint32) int
- func (fs *RemoteFs) Chown(path string, uid uint32, gid uint32) int
- func (fs *RemoteFs) Create(path string, flags int, mode uint32) (errc int, fh uint64)
- func (fs *RemoteFs) CreateEx(path string, mode uint32, fi *fuse.FileInfo_t) int
- func (fs *RemoteFs) Destroy()
- func (fs *RemoteFs) Flush(path string, fh uint64) int
- func (fs *RemoteFs) Fsync(path string, datasync bool, fh uint64) (errc int)
- func (fs *RemoteFs) Fsyncdir(path string, datasync bool, fh uint64) int
- func (fs *RemoteFs) Getattr(path string, stat *fuse.Stat_t, fh uint64) (errc int)
- func (fs *RemoteFs) Getpath(path string, fh uint64) (int, string)
- func (fs *RemoteFs) Getxattr(path string, name string) (int, []byte)
- func (fs *RemoteFs) Init()
- func (fs *RemoteFs) Link(oldpath string, newpath string) int
- func (fs *RemoteFs) Listxattr(path string, fill func(name string) bool) int
- func (fs *RemoteFs) Mkdir(path string, mode uint32) (errc int)
- func (fs *RemoteFs) Mknod(path string, mode uint32, dev uint64) int
- func (fs *RemoteFs) Open(path string, flags int) (errc int, fh uint64)
- func (fs *RemoteFs) OpenEx(path string, fi *fuse.FileInfo_t) int
- func (fs *RemoteFs) Opendir(path string) (errc int, fh uint64)
- func (fs *RemoteFs) Read(path string, buff []byte, ofst int64, fh uint64) (n int)
- func (fs *RemoteFs) Readdir(path string, fill func(name string, stat *fuse.Stat_t, ofst int64) bool, ...) (errc int)
- func (fs *RemoteFs) Readlink(path string) (int, string)
- func (fs *RemoteFs) Release(path string, fh uint64) (errc int)
- func (fs *RemoteFs) Releasedir(path string, fh uint64) (errc int)
- func (fs *RemoteFs) Removexattr(path string, name string) int
- func (fs *RemoteFs) Rename(oldpath string, newpath string) (errc int)
- func (fs *RemoteFs) Rmdir(path string) int
- func (fs *RemoteFs) Setchgtime(path string, tmsp fuse.Timespec) int
- func (fs *RemoteFs) Setcrtime(path string, tmsp fuse.Timespec) int
- func (fs *RemoteFs) Setxattr(path string, name string, value []byte, flags int) int
- func (fs *RemoteFs) Symlink(target string, newpath string) int
- func (fs *RemoteFs) Truncate(path string, size int64, fh uint64) (errc int)
- func (fs *RemoteFs) Unlink(path string) (errc int)
- func (fs *RemoteFs) Utimens(path string, tmsp []fuse.Timespec) (errc int)
- func (fs *RemoteFs) Validate() error
- func (fs *RemoteFs) Write(path string, buff []byte, ofst int64, fh uint64) (n int)
Constants ¶
const ( // DefaultWriteConcurrency is the default number of concurrent file parts to upload. DefaultWriteConcurrency = 50 // DefaultCacheTTL is the default cache TTL for the file system metadata. DefaultCacheTTL = 5 * time.Second // DefaultVolumeName is the default volume name for the file system. DefaultVolumeName = "Files.com" // DefaultDebugFuseLog is the default path to the fuse debug log. [Windows only] DefaultDebugFuseLog = "fuse.log" )
const (
// O_EVTONLY is a flag used to indicate that the file is opened for event notifications only.
O_EVTONLY = 0x8000
)
Variables ¶
var (
ErrFileHandleInUse = fmt.Errorf("file handle ID already in use")
)
Functions ¶
This section is empty.
Types ¶
type Filescomfs ¶ added in v3.2.197
type Filescomfs struct {
// contains filtered or unexported fields
}
Filescomfs is a file system that implements the fuse.FileSystem interface, allowing it to be mounted using FUSE. It provides a virtual files ystem interface to Files.com, allowing users to interact with their Files.com account as if it were a local file system.
func (*Filescomfs) Access ¶ added in v3.2.197
func (fs *Filescomfs) Access(path string, mask uint32) (errc int)
Access checks file access permissions.
func (*Filescomfs) Chflags ¶ added in v3.2.197
func (fs *Filescomfs) Chflags(path string, flags uint32) (errc int)
Chflags changes the BSD file flags (Windows file attributes).
func (*Filescomfs) Chmod ¶ added in v3.2.197
func (fs *Filescomfs) Chmod(path string, mode uint32) (errc int)
func (*Filescomfs) Chown ¶ added in v3.2.197
func (fs *Filescomfs) Chown(path string, uid uint32, gid uint32) (errc int)
Chown changes the owner and group of a file.
func (*Filescomfs) CreateEx ¶ added in v3.2.197
func (fs *Filescomfs) CreateEx(path string, mode uint32, fi *fuse.FileInfo_t) (errc int)
CreateEx is similar to Create except that it allows direct manipulation of the FileInfo_t struct.
func (*Filescomfs) Destroy ¶ added in v3.2.197
func (fs *Filescomfs) Destroy()
func (*Filescomfs) Flush ¶ added in v3.2.197
func (fs *Filescomfs) Flush(path string, fh uint64) (errc int)
Flush flushes cached file data.
func (*Filescomfs) Fsync ¶ added in v3.2.197
func (fs *Filescomfs) Fsync(path string, datasync bool, fh uint64) (errc int)
func (*Filescomfs) Fsyncdir ¶ added in v3.2.197
func (fs *Filescomfs) Fsyncdir(path string, datasync bool, fh uint64) (errc int)
Fsyncdir synchronizes directory contents.
func (*Filescomfs) Getpath ¶ added in v3.2.197
func (fs *Filescomfs) Getpath(path string, fh uint64) (errc int, result string)
Getpath allows a case-insensitive file system to report the correct case of a file path.
func (*Filescomfs) Getxattr ¶ added in v3.2.197
func (fs *Filescomfs) Getxattr(path string, name string) (errc int, value []byte)
Getxattr gets extended attributes.
func (*Filescomfs) Init ¶ added in v3.2.197
func (fs *Filescomfs) Init()
Init initializes the Filescomfs file system.
func (*Filescomfs) Link ¶ added in v3.2.197
func (fs *Filescomfs) Link(oldpath string, newpath string) (errc int)
Link creates a hard link to a file.
func (*Filescomfs) Listxattr ¶ added in v3.2.197
func (fs *Filescomfs) Listxattr(path string, fill func(name string) bool) (errc int)
Listxattr lists extended attributes.
func (*Filescomfs) Mkdir ¶ added in v3.2.197
func (fs *Filescomfs) Mkdir(path string, mode uint32) (errc int)
func (*Filescomfs) Mknod ¶ added in v3.2.197
func (fs *Filescomfs) Mknod(path string, mode uint32, dev uint64) (errc int)
Mknod creates a file node.
func (*Filescomfs) Open ¶ added in v3.2.197
func (fs *Filescomfs) Open(path string, flags int) (errc int, fh uint64)
func (*Filescomfs) OpenEx ¶ added in v3.2.197
func (fs *Filescomfs) OpenEx(path string, fi *fuse.FileInfo_t) (errc int)
OpenEx is similar to Open except that it allows direct manipulation of the FileInfo_t struct.
func (*Filescomfs) Opendir ¶ added in v3.2.197
func (fs *Filescomfs) Opendir(path string) (errc int, fh uint64)
func (*Filescomfs) Readlink ¶ added in v3.2.197
func (fs *Filescomfs) Readlink(path string) (errc int, target string)
Readlink reads the target of a symbolic link.
func (*Filescomfs) Release ¶ added in v3.2.197
func (fs *Filescomfs) Release(path string, fh uint64) (errc int)
func (*Filescomfs) Releasedir ¶ added in v3.2.197
func (fs *Filescomfs) Releasedir(path string, fh uint64) (errc int)
func (*Filescomfs) Removexattr ¶ added in v3.2.197
func (fs *Filescomfs) Removexattr(path string, name string) (errc int)
Removexattr removes extended attributes.
func (*Filescomfs) Rename ¶ added in v3.2.197
func (fs *Filescomfs) Rename(oldpath string, newpath string) (errc int)
func (*Filescomfs) Rmdir ¶ added in v3.2.197
func (fs *Filescomfs) Rmdir(path string) int
func (*Filescomfs) Setchgtime ¶ added in v3.2.197
func (fs *Filescomfs) Setchgtime(path string, tmsp fuse.Timespec) (errc int)
Setchgtime changes the file change (ctime) time.
func (*Filescomfs) Setcrtime ¶ added in v3.2.197
func (fs *Filescomfs) Setcrtime(path string, tmsp fuse.Timespec) (errc int)
Setcrtime changes the file creation (birth) time.
func (*Filescomfs) Statfs ¶ added in v3.2.197
func (fs *Filescomfs) Statfs(path string, stat *fuse.Statfs_t) (errc int)
func (*Filescomfs) Symlink ¶ added in v3.2.197
func (fs *Filescomfs) Symlink(target string, newpath string) (errc int)
Symlink creates a symbolic link.
func (*Filescomfs) Truncate ¶ added in v3.2.197
func (fs *Filescomfs) Truncate(path string, size int64, fh uint64) (errc int)
func (*Filescomfs) Unlink ¶ added in v3.2.197
func (fs *Filescomfs) Unlink(path string) (errc int)
func (*Filescomfs) Utimens ¶ added in v3.2.197
func (fs *Filescomfs) Utimens(path string, tmsp []fuse.Timespec) (errc int)
func (*Filescomfs) Validate ¶ added in v3.2.197
func (fs *Filescomfs) Validate() error
Validate checks if the Filescomfs file system is valid by attempting to list the root directories of the RemoteFs and LocalFs.
type FuseFlags ¶ added in v3.2.220
type FuseFlags int
func NewFuseFlags ¶ added in v3.2.220
NewFuseFlags initializes a FuseFlags instance with the given integer flag value.
func (FuseFlags) IsCreateExclusive ¶ added in v3.2.220
func (FuseFlags) IsEventOnly ¶ added in v3.2.220
IsEventOnly checks if the flag is open for event notifications only.
func (FuseFlags) IsExclusive ¶ added in v3.2.220
IsExclusive checks if the flag is set to exclusive.
func (FuseFlags) IsReadOnly ¶ added in v3.2.220
IsReadOnly checks if the flag is set to read-only.
func (FuseFlags) IsReadWrite ¶ added in v3.2.220
IsReadWrite checks if the flag is set to read-write.
func (FuseFlags) IsTruncate ¶ added in v3.2.220
IsTruncate checks if the flag is set to truncate.
func (FuseFlags) IsWriteOnly ¶ added in v3.2.220
IsWriteOnly checks if the flag is set to write-only.
type Host ¶ added in v3.2.240
type Host struct {
// contains filtered or unexported fields
}
Host acts as a wrapper around a fuse.FileSystemHost and an fsmount.Filescomfs to allow interception unmount, and notify calls. This is primarily to facilitate calling Unmount on macOS because the unmount action on macOS does not reliably propagate to the underlying file system implementations, which means they don't reliably have the opportunity to clean up resources.
func Mount ¶ added in v3.2.197
func Mount(params MountParams) (*Host, error)
Mount initializes a Files.com file system and mounts it using FUSE.
type LocalFs ¶ added in v3.2.235
type LocalFs struct {
// contains filtered or unexported fields
}
LocalFs is a used as a passthrough files system to the host operating system's file system for the local mount point. It is used for files that are considered temporary or that should not be uploaded to Files.com. In order to support programs that use the type of files that are not intended to be uploaded to Files.com, the Filescomfs can delegate those operations to this implementation.
func (*LocalFs) Access ¶ added in v3.2.235
Access checks file access permissions. The return value of -fuse.ENOSYS indicates the method is not supported.
func (*LocalFs) Chflags ¶ added in v3.2.235
Chflags is part of the FileSystemChflags interface and changes the BSD file flags (Windows file attributes).
func (*LocalFs) Chown ¶ added in v3.2.235
Chown changes the owner and group of a file. The return value of -fuse.ENOSYS indicates the method is not supported.
func (*LocalFs) CreateEx ¶ added in v3.2.235
OpenEx and CreateEx are similar to Open and Create except that they allow direct manipulation of the FileInfo_t struct (which is analogous to the FUSE struct fuse_file_info). If implemented, they are preferred over Open and Create.
func (*LocalFs) Flush ¶ added in v3.2.235
Flush flushes cached file data. The return value of -fuse.ENOSYS indicates the method is not supported.
func (*LocalFs) Fsyncdir ¶ added in v3.2.235
Fsyncdir synchronizes directory contents. The return value of -fuse.ENOSYS indicates the method is not supported.
func (*LocalFs) Getpath ¶ added in v3.2.235
Getpath is part of the FileSystemGetpath interface and allows a case-insensitive file system to report the correct case of a file path.
func (*LocalFs) Getxattr ¶ added in v3.2.235
Getxattr gets extended attributes. Any return value other than -fuse.ENOSYS indicates support for extended attributes, but also expects Setxattr, Listxattr, and Removexattr to exist for extended attribute support.
func (*LocalFs) Link ¶ added in v3.2.235
Link creates a hard link to a file. The return value of -fuse.ENOSYS indicates the method is not supported.
func (*LocalFs) Mknod ¶ added in v3.2.235
Mknod creates a file node. The return value of -fuse.ENOSYS indicates the method is not supported.
func (*LocalFs) OpenEx ¶ added in v3.2.235
func (fs *LocalFs) OpenEx(path string, fi *fuse.FileInfo_t) int
func (*LocalFs) Readlink ¶ added in v3.2.235
Readlink reads the target of a symbolic link. The return value of -fuse.ENOSYS indicates the method is not supported.
func (*LocalFs) Releasedir ¶ added in v3.2.235
func (*LocalFs) Removexattr ¶ added in v3.2.235
Removexattr removes extended attributes.
func (*LocalFs) Setchgtime ¶ added in v3.2.235
Setchgtime is part of the FileSystemSetchgtime interface and changes the file change (ctime) time.
func (*LocalFs) Setcrtime ¶ added in v3.2.235
Setcrtime is part of the FileSystemSetcrtime interface and changes the file creation (birth) time.
func (*LocalFs) Symlink ¶ added in v3.2.235
Symlink creates a symbolic link. The return value of -fuse.ENOSYS indicates the method is not supported.
type MountParams ¶ added in v3.2.197
type MountParams struct { // Required. Files.com API configuration. Config *files_sdk.Config // Path to mount the file system. // // Optional on Windows. If provided, this is expected to be a drive letter // followed by a colon (e.g. "Z:"). If not specified, the letter closest to // the end of the Latin alphabet that is not already in use will be chosen. // // Required on MacOS and Linux, this is the path to the directory where mount points // will be located (e.g. "/mnt/files"). MountPoint string // Optional. Path to a temporary directory for storing files that don't belong on Files.com. // e.g. .DS_Store, Thumbs.db, etc... The full list of patterns is available in the ignore package // https://github.com/Files-com/files-sdk-go/tree/master/ignore/data // // Defaults to OS-specific temporary directory if not specified. TmpFsPath string // Optional. Volume name to display in Finder/Explorer. On Windows, this is also used as the // share name for the UNC path. Defaults to "Files.com". VolumeName string // Optional. Files.com path to mount as the root of the file system. Defaults to the site root. Root string // Optional. Number of concurrent file parts to upload. Defaults to 50. WriteConcurrency int // Optional. Cache TTL for the file system metadata. Defaults to 5 seconds. CacheTTL time.Duration // Optional. Disable use of Files.com locks when writing files. Defaults to false. DisableLocking bool // Optional. List of patterns to ignore when creating files and directories. Defaults to // OS-specific defaults. To ignore no patterns, pass an empty slice. IgnorePatterns []string // Optional. If set to true, will initialize fuse configured to provide extra debug information. // Defaults to false. DebugFuse bool // Optional. The path to the fuse debug log. Only used if DebugFuse is set to true. // Defaults to fuse.log [Windows only] DebugFuseLog string // Optional. The path to the icon to display in Finder. If not specified, the default icon // for a network drive is used. [MacOS only] IconPath string }
MountParams contains the parameters for mounting a Files.com file system using FUSE.
type OpenHandles ¶ added in v3.2.220
type OpenHandles struct {
// contains filtered or unexported fields
}
OpenHandles tracks currently-open FUSE file handles and allocates fresh IDs.
func NewOpenHandles ¶ added in v3.2.220
func NewOpenHandles(logger lib.LeveledLogger) *OpenHandles
NewOpenHandles initializes a new OpenHandles instance.
func (*OpenHandles) Close ¶ added in v3.2.235
func (h *OpenHandles) Close()
func (*OpenHandles) ExtendOpenHandleTtls ¶ added in v3.2.220
func (h *OpenHandles) ExtendOpenHandleTtls()
ExtendOpenHandleTtls extends the TTL of all open handles. This is useful to keep the file handles alive while the OS is still using them.
func (*OpenHandles) Lookup ¶ added in v3.2.220
func (h *OpenHandles) Lookup(id uint64) (*fileHandle, *fsNode, bool)
Lookup finds a fileHandle and node without holding the lock during use.
func (*OpenHandles) Open ¶ added in v3.2.220
func (h *OpenHandles) Open(node *fsNode, flags FuseFlags) (id uint64, fh *fileHandle)
Open creates a new ID and stores the handle. Never hold h.mu while allocating the ID to avoid lock-order issues.
func (*OpenHandles) OpenHandles ¶ added in v3.2.220
func (h *OpenHandles) OpenHandles() []*fileHandle
OpenHandles returns a slice of open file handles, excluding the root handle.
func (*OpenHandles) OpenWithFile ¶ added in v3.2.235
func (h *OpenHandles) OpenWithFile(node *fsNode, flags FuseFlags, file *os.File) (id uint64, fh *fileHandle)
OpenWithFile uses the given *os.File to create and store a new handle. Never hold h.mu while allocating the ID to avoid lock-order issues.
func (*OpenHandles) Release ¶ added in v3.2.220
func (h *OpenHandles) Release(id uint64) (*fileHandle, bool)
Release removes a fileHandle by id. Safe to call even if the handle was already closed.
type RemoteFs ¶ added in v3.2.235
type RemoteFs struct {
// contains filtered or unexported fields
}
RemoteFs is a file system that implements the logic for interacting with the Files.com API for a mounted file system. It handles all operations that are not handled by the LocalFs implementation, which is used for temporary files and files that should not be uploaded to Files.com. The Filescomfs implementation delegates operations to this implementation for all files who's source/destination is Files.com.
func (*RemoteFs) Access ¶ added in v3.2.235
Access checks file access permissions. The return value of -fuse.ENOSYS indicates the method is not supported.
func (*RemoteFs) Chflags ¶ added in v3.2.235
Chflags is part of the FileSystemChflags interface and changes the BSD file flags (Windows file attributes).
func (*RemoteFs) Chmod ¶ added in v3.2.235
Chmod changes the permission bits of a file. Files.com does not support POSIX permissions, but certain operations may fail if calling Chmod returns an error, so this implementation is a no-op that returns success.
func (*RemoteFs) Chown ¶ added in v3.2.235
Chown changes the owner and group of a file. The return value of -fuse.ENOSYS indicates the method is not supported.
func (*RemoteFs) CreateEx ¶ added in v3.2.235
OpenEx and CreateEx are similar to Open and Create except that they allow direct manipulation of the FileInfo_t struct (which is analogous to the FUSE struct fuse_file_info). If implemented, they are preferred over Open and Create.
func (*RemoteFs) Flush ¶ added in v3.2.235
Flush flushes cached file data. The return value of -fuse.ENOSYS indicates the method is not supported.
func (*RemoteFs) Fsync ¶ added in v3.2.235
Fsync attempts to synchronize file contents. If an upload is active but the writer is already closed (finalizing in background), wait for completion. Otherwise, fall back to ENOSYS.
func (*RemoteFs) Fsyncdir ¶ added in v3.2.235
Fsyncdir synchronizes directory contents. The return value of -fuse.ENOSYS indicates the method is not supported.
func (*RemoteFs) Getpath ¶ added in v3.2.235
Getpath is part of the FileSystemGetpath interface and allows a case-insensitive file system to report the correct case of a file path.
func (*RemoteFs) Getxattr ¶ added in v3.2.235
Getxattr gets extended attributes. Any return value other than -fuse.ENOSYS indicates support for extended attributes, but also expects Setxattr, Listxattr, and Removexattr to exist for extended attribute support.
func (*RemoteFs) Link ¶ added in v3.2.235
Link creates a hard link to a file. The return value of -fuse.ENOSYS indicates the method is not supported.
func (*RemoteFs) Mknod ¶ added in v3.2.235
Mknod creates a file node. The return value of -fuse.ENOSYS indicates the method is not supported.
func (*RemoteFs) OpenEx ¶ added in v3.2.235
func (fs *RemoteFs) OpenEx(path string, fi *fuse.FileInfo_t) int
func (*RemoteFs) Readlink ¶ added in v3.2.235
Readlink reads the target of a symbolic link. The return value of -fuse.ENOSYS indicates the method is not supported.
func (*RemoteFs) Releasedir ¶ added in v3.2.235
func (*RemoteFs) Removexattr ¶ added in v3.2.235
Removexattr removes extended attributes.
func (*RemoteFs) Setchgtime ¶ added in v3.2.235
Setchgtime is part of the FileSystemSetchgtime interface and changes the file change (ctime) time.
func (*RemoteFs) Setcrtime ¶ added in v3.2.235
Setcrtime is part of the FileSystemSetcrtime interface and changes the file creation (birth) time.
func (*RemoteFs) Symlink ¶ added in v3.2.235
Symlink creates a symbolic link. The return value of -fuse.ENOSYS indicates the method is not supported.