123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.FLAGS = exports.ERRSTR = void 0;
- const constants_1 = require("../constants");
- exports.ERRSTR = {
- PATH_STR: 'path must be a string or Buffer',
-
- 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 } = constants_1.constants;
- var FLAGS;
- (function (FLAGS) {
-
- FLAGS[FLAGS["r"] = O_RDONLY] = "r";
-
- FLAGS[FLAGS["r+"] = O_RDWR] = "r+";
-
- FLAGS[FLAGS["rs"] = O_RDONLY | O_SYNC] = "rs";
- FLAGS[FLAGS["sr"] = FLAGS.rs] = "sr";
-
- FLAGS[FLAGS["rs+"] = O_RDWR | O_SYNC] = "rs+";
- FLAGS[FLAGS["sr+"] = FLAGS['rs+']] = "sr+";
-
- FLAGS[FLAGS["w"] = O_WRONLY | O_CREAT | O_TRUNC] = "w";
-
- FLAGS[FLAGS["wx"] = O_WRONLY | O_CREAT | O_TRUNC | O_EXCL] = "wx";
- FLAGS[FLAGS["xw"] = FLAGS.wx] = "xw";
-
- FLAGS[FLAGS["w+"] = O_RDWR | O_CREAT | O_TRUNC] = "w+";
-
- FLAGS[FLAGS["wx+"] = O_RDWR | O_CREAT | O_TRUNC | O_EXCL] = "wx+";
- FLAGS[FLAGS["xw+"] = FLAGS['wx+']] = "xw+";
-
- FLAGS[FLAGS["a"] = O_WRONLY | O_APPEND | O_CREAT] = "a";
-
- FLAGS[FLAGS["ax"] = O_WRONLY | O_APPEND | O_CREAT | O_EXCL] = "ax";
- FLAGS[FLAGS["xa"] = FLAGS.ax] = "xa";
-
- FLAGS[FLAGS["a+"] = O_RDWR | O_APPEND | O_CREAT] = "a+";
-
- FLAGS[FLAGS["ax+"] = O_RDWR | O_APPEND | O_CREAT | O_EXCL] = "ax+";
- FLAGS[FLAGS["xa+"] = FLAGS['ax+']] = "xa+";
- })(FLAGS || (exports.FLAGS = FLAGS = {}));
|