Skip to content

Commit

Permalink
fsop: improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
billziss-gh committed Nov 17, 2017
1 parent 1e5da29 commit 487e2ba
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions fuse/fsop.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ import (
"time"
)

// Error codes reported by FUSE file systems.
const (
E2BIG = int(C.E2BIG)
EACCES = int(C.EACCES)
Expand Down Expand Up @@ -229,6 +230,7 @@ const (
EXDEV = int(C.EXDEV)
)

// Flags used in FileSystemInterface.Create and FileSystemInterface.Open.
const (
O_RDONLY = int(C.O_RDONLY)
O_WRONLY = int(C.O_WRONLY)
Expand All @@ -240,6 +242,7 @@ const (
O_ACCMODE = int(C.O_ACCMODE)
)

// File type and permission bits.
const (
S_IFMT = 0170000
S_IFBLK = 0060000
Expand Down Expand Up @@ -267,13 +270,15 @@ const (
S_ISVTX = 01000
)

// BSD file flags (Windows file attributes).
const (
UF_HIDDEN = 0x00008000
UF_READONLY = 0x00001000
UF_SYSTEM = 0x00000080
UF_ARCHIVE = 0x00000800
)

// Options that control Setxattr operation.
const (
XATTR_CREATE = int(C.XATTR_CREATE)
XATTR_REPLACE = int(C.XATTR_REPLACE)
Expand Down Expand Up @@ -476,9 +481,11 @@ type FileSystemInterface interface {
Access(path string, mask uint32) int

// Create creates and opens a file.
// The flags are a combination of the fuse.O_* constants.
Create(path string, flags int, mode uint32) (int, uint64)

// Open opens a file.
// The flags are a combination of the fuse.O_* constants.
Open(path string, flags int) (int, uint64)

// Getattr gets file attributes.
Expand Down Expand Up @@ -661,12 +668,14 @@ func (*FileSystemBase) Access(path string, mask uint32) int {
}

// Create creates and opens a file.
// The flags are a combination of the fuse.O_* constants.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Create(path string, flags int, mode uint32) (int, uint64) {
return -ENOSYS, ^uint64(0)
}

// Open opens a file.
// The flags are a combination of the fuse.O_* constants.
// The FileSystemBase implementation returns -ENOSYS.
func (*FileSystemBase) Open(path string, flags int) (int, uint64) {
return -ENOSYS, ^uint64(0)
Expand Down

0 comments on commit 487e2ba

Please sign in to comment.