mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-14 16:03:41 +00:00
os: add FileMode constants from Go 1.16
This commit is contained in:
@@ -83,3 +83,31 @@ func WriteFile(name string, data []byte, perm FileMode) error {
|
|||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The defined file mode bits are the most significant bits of the FileMode.
|
||||||
|
// The nine least-significant bits are the standard Unix rwxrwxrwx permissions.
|
||||||
|
// The values of these bits should be considered part of the public API and
|
||||||
|
// may be used in wire protocols or disk representations: they must not be
|
||||||
|
// changed, although new bits might be added.
|
||||||
|
const (
|
||||||
|
// The single letters are the abbreviations
|
||||||
|
// used by the String method's formatting.
|
||||||
|
ModeDir = fs.ModeDir // d: is a directory
|
||||||
|
ModeAppend = fs.ModeAppend // a: append-only
|
||||||
|
ModeExclusive = fs.ModeExclusive // l: exclusive use
|
||||||
|
ModeTemporary = fs.ModeTemporary // T: temporary file; Plan 9 only
|
||||||
|
ModeSymlink = fs.ModeSymlink // L: symbolic link
|
||||||
|
ModeDevice = fs.ModeDevice // D: device file
|
||||||
|
ModeNamedPipe = fs.ModeNamedPipe // p: named pipe (FIFO)
|
||||||
|
ModeSocket = fs.ModeSocket // S: Unix domain socket
|
||||||
|
ModeSetuid = fs.ModeSetuid // u: setuid
|
||||||
|
ModeSetgid = fs.ModeSetgid // g: setgid
|
||||||
|
ModeCharDevice = fs.ModeCharDevice // c: Unix character device, when ModeDevice is set
|
||||||
|
ModeSticky = fs.ModeSticky // t: sticky
|
||||||
|
ModeIrregular = fs.ModeIrregular // ?: non-regular file; nothing else is known about this file
|
||||||
|
|
||||||
|
// Mask for the type bits. For regular files, none will be set.
|
||||||
|
ModeType = fs.ModeType
|
||||||
|
|
||||||
|
ModePerm = fs.ModePerm // Unix permission bits, 0o777
|
||||||
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user