| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.FLAGS = exports.ERRSTR = exports.constants = exports.SEP = void 0;
- exports.SEP = '/';
- exports.constants = {
- O_RDONLY: 0,
- O_WRONLY: 1,
- O_RDWR: 2,
- S_IFMT: 61440,
- S_IFREG: 32768,
- S_IFDIR: 16384,
- S_IFCHR: 8192,
- S_IFBLK: 24576,
- S_IFIFO: 4096,
- S_IFLNK: 40960,
- S_IFSOCK: 49152,
- O_CREAT: 64,
- O_EXCL: 128,
- O_NOCTTY: 256,
- O_TRUNC: 512,
- O_APPEND: 1024,
- O_DIRECTORY: 65536,
- O_NOATIME: 262144,
- O_NOFOLLOW: 131072,
- O_SYNC: 1052672,
- O_SYMLINK: 2097152,
- O_DIRECT: 16384,
- O_NONBLOCK: 2048,
- S_IRWXU: 448,
- S_IRUSR: 256,
- S_IWUSR: 128,
- S_IXUSR: 64,
- S_IRWXG: 56,
- S_IRGRP: 32,
- S_IWGRP: 16,
- S_IXGRP: 8,
- S_IRWXO: 7,
- S_IROTH: 4,
- S_IWOTH: 2,
- S_IXOTH: 1,
- F_OK: 0,
- R_OK: 4,
- W_OK: 2,
- X_OK: 1,
- UV_FS_SYMLINK_DIR: 1,
- UV_FS_SYMLINK_JUNCTION: 2,
- UV_FS_COPYFILE_EXCL: 1,
- UV_FS_COPYFILE_FICLONE: 2,
- UV_FS_COPYFILE_FICLONE_FORCE: 4,
- COPYFILE_EXCL: 1,
- COPYFILE_FICLONE: 2,
- COPYFILE_FICLONE_FORCE: 4,
- };
- exports.ERRSTR = {
- PATH_STR: 'path must be a string, Buffer, or Uint8Array',
- // FD: 'file descriptor must be a unsigned 32-bit integer',
- FD: 'fd must be a file descriptor',
- MODE_INT: 'mode must be an int',
- CB: 'callback must be a function',
- UID: 'uid must be an unsigned int',
- GID: 'gid must be an unsigned int',
- LEN: 'len must be an integer',
- ATIME: 'atime must be an integer',
- MTIME: 'mtime must be an integer',
- PREFIX: 'filename prefix is required',
- BUFFER: 'buffer must be an instance of Buffer or StaticBuffer',
- OFFSET: 'offset must be an integer',
- LENGTH: 'length must be an integer',
- POSITION: 'position must be an integer',
- };
- const { O_RDONLY, O_WRONLY, O_RDWR, O_CREAT, O_EXCL, O_TRUNC, O_APPEND, O_SYNC } = exports.constants;
- // List of file `flags` as defined by Node.
- var FLAGS;
- (function (FLAGS) {
- // Open file for reading. An exception occurs if the file does not exist.
- FLAGS[FLAGS["r"] = O_RDONLY] = "r";
- // Open file for reading and writing. An exception occurs if the file does not exist.
- FLAGS[FLAGS["r+"] = O_RDWR] = "r+";
- // Open file for reading in synchronous mode. Instructs the operating system to bypass the local file system cache.
- FLAGS[FLAGS["rs"] = O_RDONLY | O_SYNC] = "rs";
- FLAGS[FLAGS["sr"] = FLAGS.rs] = "sr";
- // Open file for reading and writing, telling the OS to open it synchronously. See notes for 'rs' about using this with caution.
- FLAGS[FLAGS["rs+"] = O_RDWR | O_SYNC] = "rs+";
- FLAGS[FLAGS["sr+"] = FLAGS['rs+']] = "sr+";
- // Open file for writing. The file is created (if it does not exist) or truncated (if it exists).
- FLAGS[FLAGS["w"] = O_WRONLY | O_CREAT | O_TRUNC] = "w";
- // Like 'w' but fails if path exists.
- FLAGS[FLAGS["wx"] = O_WRONLY | O_CREAT | O_TRUNC | O_EXCL] = "wx";
- FLAGS[FLAGS["xw"] = FLAGS.wx] = "xw";
- // Open file for reading and writing. The file is created (if it does not exist) or truncated (if it exists).
- FLAGS[FLAGS["w+"] = O_RDWR | O_CREAT | O_TRUNC] = "w+";
- // Like 'w+' but fails if path exists.
- FLAGS[FLAGS["wx+"] = O_RDWR | O_CREAT | O_TRUNC | O_EXCL] = "wx+";
- FLAGS[FLAGS["xw+"] = FLAGS['wx+']] = "xw+";
- // Open file for appending. The file is created if it does not exist.
- FLAGS[FLAGS["a"] = O_WRONLY | O_APPEND | O_CREAT] = "a";
- // Like 'a' but fails if path exists.
- FLAGS[FLAGS["ax"] = O_WRONLY | O_APPEND | O_CREAT | O_EXCL] = "ax";
- FLAGS[FLAGS["xa"] = FLAGS.ax] = "xa";
- // Open file for reading and appending. The file is created if it does not exist.
- FLAGS[FLAGS["a+"] = O_RDWR | O_APPEND | O_CREAT] = "a+";
- // Like 'a+' but fails if path exists.
- FLAGS[FLAGS["ax+"] = O_RDWR | O_APPEND | O_CREAT | O_EXCL] = "ax+";
- FLAGS[FLAGS["xa+"] = FLAGS['ax+']] = "xa+";
- })(FLAGS || (exports.FLAGS = FLAGS = {}));
- //# sourceMappingURL=constants.js.map
|