@zenfs/core 2.2.2 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backends/backend.js +6 -9
- package/dist/backends/cow.js +4 -4
- package/dist/backends/fetch.js +8 -6
- package/dist/backends/memory.js +4 -2
- package/dist/backends/passthrough.js +2 -0
- package/dist/backends/port.d.ts +16 -89
- package/dist/backends/port.js +35 -171
- package/dist/backends/single_buffer.d.ts +4 -2
- package/dist/backends/single_buffer.js +169 -195
- package/dist/backends/store/fs.js +50 -73
- package/dist/backends/store/map.js +1 -2
- package/dist/backends/store/store.js +23 -27
- package/dist/config.js +2 -3
- package/dist/context.js +2 -2
- package/dist/internal/credentials.d.ts +6 -0
- package/dist/internal/credentials.js +10 -0
- package/dist/internal/devices.js +7 -10
- package/dist/internal/file_index.js +3 -8
- package/dist/internal/filesystem.js +19 -12
- package/dist/internal/index_fs.js +3 -4
- package/dist/internal/inode.d.ts +2 -0
- package/dist/internal/inode.js +148 -185
- package/dist/internal/rpc.d.ts +143 -0
- package/dist/internal/rpc.js +251 -0
- package/dist/mixins/async.js +5 -6
- package/dist/mixins/mutexed.js +16 -10
- package/dist/path.js +3 -4
- package/dist/polyfills.js +51 -22
- package/dist/readline.js +32 -30
- package/dist/utils.d.ts +3 -2
- package/dist/utils.js +11 -5
- package/dist/vfs/acl.d.ts +2 -0
- package/dist/vfs/acl.js +48 -66
- package/dist/vfs/async.js +4 -4
- package/dist/vfs/dir.d.ts +4 -3
- package/dist/vfs/dir.js +16 -10
- package/dist/vfs/file.js +22 -18
- package/dist/vfs/ioctl.js +39 -62
- package/dist/vfs/promises.d.ts +33 -25
- package/dist/vfs/promises.js +56 -47
- package/dist/vfs/shared.js +7 -7
- package/dist/vfs/stats.js +104 -77
- package/dist/vfs/streams.js +11 -8
- package/dist/vfs/sync.d.ts +22 -11
- package/dist/vfs/sync.js +24 -27
- package/dist/vfs/types.d.ts +3 -8
- package/dist/vfs/watchers.js +9 -3
- package/dist/vfs/xattr.js +6 -12
- package/package.json +2 -2
- package/scripts/test.js +14 -7
- package/tests/backend/fetch.test.ts +14 -14
- package/tests/backend/port.test.ts +25 -17
- package/tests/common/context.test.ts +14 -0
- package/tests/common/handle.test.ts +5 -3
- package/tests/fetch/run.sh +2 -1
- package/tests/fs/scaling.test.ts +32 -0
- package/tests/fs/watch.test.ts +2 -5
- package/tests/setup/single-buffer.ts +1 -1
- package/tests/tsconfig.json +3 -2
- package/types/uint8array.d.ts +64 -0
|
@@ -12,10 +12,7 @@ export const version = 1;
|
|
|
12
12
|
* @internal
|
|
13
13
|
*/
|
|
14
14
|
export class Index extends Map {
|
|
15
|
-
|
|
16
|
-
super(...arguments);
|
|
17
|
-
this.maxSize = size_max;
|
|
18
|
-
}
|
|
15
|
+
maxSize = size_max;
|
|
19
16
|
/**
|
|
20
17
|
* Converts the index to JSON
|
|
21
18
|
*/
|
|
@@ -54,8 +51,7 @@ export class Index extends Map {
|
|
|
54
51
|
}
|
|
55
52
|
}
|
|
56
53
|
getByID(id) {
|
|
57
|
-
|
|
58
|
-
return (_a = this.entryByID(id)) === null || _a === void 0 ? void 0 : _a.inode;
|
|
54
|
+
return this.entryByID(id)?.inode;
|
|
59
55
|
}
|
|
60
56
|
entryByID(id) {
|
|
61
57
|
for (const [path, inode] of this) {
|
|
@@ -106,12 +102,11 @@ export class Index extends Map {
|
|
|
106
102
|
* Loads the index from JSON data
|
|
107
103
|
*/
|
|
108
104
|
fromJSON(json) {
|
|
109
|
-
var _a;
|
|
110
105
|
if (json.version != version)
|
|
111
106
|
throw withErrno('EINVAL', 'Index version mismatch');
|
|
112
107
|
this.clear();
|
|
113
108
|
for (const [path, node] of Object.entries(json.entries)) {
|
|
114
|
-
|
|
109
|
+
node.data ??= randomInt(1, size_max);
|
|
115
110
|
if (path == '/')
|
|
116
111
|
node.ino = 0;
|
|
117
112
|
this.set(path, new Inode(node));
|
|
@@ -7,9 +7,27 @@ const _chunkSize = 0x1000;
|
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
9
9
|
export class FileSystem {
|
|
10
|
+
type;
|
|
11
|
+
name;
|
|
12
|
+
label;
|
|
13
|
+
/**
|
|
14
|
+
* The last place this file system was mounted
|
|
15
|
+
* @internal @protected
|
|
16
|
+
*/
|
|
17
|
+
_mountPoint;
|
|
18
|
+
/**
|
|
19
|
+
* The UUID of the file system.
|
|
20
|
+
* @privateRemarks This is only used by `ioctl`
|
|
21
|
+
* @internal @protected
|
|
22
|
+
*/
|
|
23
|
+
_uuid = crypto.randomUUID();
|
|
10
24
|
get uuid() {
|
|
11
25
|
return this._uuid;
|
|
12
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* @see FileSystemAttributes
|
|
29
|
+
*/
|
|
30
|
+
attributes = new Map();
|
|
13
31
|
constructor(
|
|
14
32
|
/**
|
|
15
33
|
* A unique ID for this kind of file system.
|
|
@@ -23,16 +41,6 @@ export class FileSystem {
|
|
|
23
41
|
name) {
|
|
24
42
|
this.type = type;
|
|
25
43
|
this.name = name;
|
|
26
|
-
/**
|
|
27
|
-
* The UUID of the file system.
|
|
28
|
-
* @privateRemarks This is only used by `ioctl`
|
|
29
|
-
* @internal @protected
|
|
30
|
-
*/
|
|
31
|
-
this._uuid = crypto.randomUUID();
|
|
32
|
-
/**
|
|
33
|
-
* @see FileSystemAttributes
|
|
34
|
-
*/
|
|
35
|
-
this.attributes = new Map();
|
|
36
44
|
if (this.streamRead === FileSystem.prototype.streamRead)
|
|
37
45
|
this.attributes.set('default_stream_read');
|
|
38
46
|
if (this.streamWrite === FileSystem.prototype.streamWrite)
|
|
@@ -102,8 +110,7 @@ export class FileSystem {
|
|
|
102
110
|
* @privateRemarks The default implementation of `streamWrite` uses "chunked" `write`s
|
|
103
111
|
*/
|
|
104
112
|
streamWrite(path, options) {
|
|
105
|
-
|
|
106
|
-
let position = (_a = options.start) !== null && _a !== void 0 ? _a : 0;
|
|
113
|
+
let position = options.start ?? 0;
|
|
107
114
|
return new WritableStream({
|
|
108
115
|
write: async (chunk, controller) => {
|
|
109
116
|
let err = false;
|
|
@@ -12,6 +12,7 @@ import { Inode } from './inode.js';
|
|
|
12
12
|
* @internal
|
|
13
13
|
*/
|
|
14
14
|
export class IndexFS extends FileSystem {
|
|
15
|
+
index;
|
|
15
16
|
constructor(id, name, index = new Index()) {
|
|
16
17
|
super(id, name);
|
|
17
18
|
this.index = index;
|
|
@@ -76,13 +77,11 @@ export class IndexFS extends FileSystem {
|
|
|
76
77
|
return inode;
|
|
77
78
|
}
|
|
78
79
|
async touch(path, metadata) {
|
|
79
|
-
|
|
80
|
-
const inode = (_a = this.index.get(path)) !== null && _a !== void 0 ? _a : _throw(withErrno('ENOENT'));
|
|
80
|
+
const inode = this.index.get(path) ?? _throw(withErrno('ENOENT'));
|
|
81
81
|
inode.update(metadata);
|
|
82
82
|
}
|
|
83
83
|
touchSync(path, metadata) {
|
|
84
|
-
|
|
85
|
-
const inode = (_a = this.index.get(path)) !== null && _a !== void 0 ? _a : _throw(withErrno('ENOENT'));
|
|
84
|
+
const inode = this.index.get(path) ?? _throw(withErrno('ENOENT'));
|
|
86
85
|
inode.update(metadata);
|
|
87
86
|
}
|
|
88
87
|
_remove(path, isUnlink) {
|
package/dist/internal/inode.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export declare const rootIno = 0;
|
|
|
12
12
|
* @internal
|
|
13
13
|
*/
|
|
14
14
|
export declare class Attributes extends BufferView {
|
|
15
|
+
static readonly name = "Attributes";
|
|
15
16
|
accessor size: number;
|
|
16
17
|
['constructor']: typeof Attributes;
|
|
17
18
|
get byteSize(): number;
|
|
@@ -106,6 +107,7 @@ export declare const userModifiableFlags = 229631;
|
|
|
106
107
|
* @internal
|
|
107
108
|
*/
|
|
108
109
|
export declare class Inode extends BufferView implements InodeLike {
|
|
110
|
+
static readonly name = "Inode";
|
|
109
111
|
constructor(...args: ConstructorParameters<typeof BufferView> | [Readonly<Partial<InodeLike>>]);
|
|
110
112
|
accessor data: number;
|
|
111
113
|
/** For future use */
|
package/dist/internal/inode.js
CHANGED
|
@@ -32,21 +32,6 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
32
32
|
}
|
|
33
33
|
return useValue ? value : void 0;
|
|
34
34
|
};
|
|
35
|
-
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
|
36
|
-
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
37
|
-
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
38
|
-
};
|
|
39
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
40
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
41
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
42
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
43
|
-
};
|
|
44
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
45
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
46
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
47
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
48
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
49
|
-
};
|
|
50
35
|
import { withErrno } from 'kerium';
|
|
51
36
|
import { crit, warn } from 'kerium/log';
|
|
52
37
|
import { field, packed, sizeof, struct, types as t } from 'memium';
|
|
@@ -63,7 +48,6 @@ export const rootIno = 0;
|
|
|
63
48
|
/** 4 KiB minus static inode data */
|
|
64
49
|
const maxDynamicData = 3968;
|
|
65
50
|
let Attribute = (() => {
|
|
66
|
-
var _Attribute_keySize_accessor_storage, _Attribute_valueSize_accessor_storage;
|
|
67
51
|
var _a, _b;
|
|
68
52
|
let _classDecorators = [struct(packed)];
|
|
69
53
|
let _classDescriptor;
|
|
@@ -76,11 +60,25 @@ let Attribute = (() => {
|
|
|
76
60
|
let _valueSize_decorators;
|
|
77
61
|
let _valueSize_initializers = [];
|
|
78
62
|
let _valueSize_extraInitializers = [];
|
|
79
|
-
var Attribute =
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
63
|
+
var Attribute = class extends _classSuper {
|
|
64
|
+
static { _classThis = this; }
|
|
65
|
+
static {
|
|
66
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
67
|
+
_keySize_decorators = [(_a = t).uint32.bind(_a)];
|
|
68
|
+
_valueSize_decorators = [(_b = t).uint32.bind(_b)];
|
|
69
|
+
__esDecorate(this, null, _keySize_decorators, { kind: "accessor", name: "keySize", static: false, private: false, access: { has: obj => "keySize" in obj, get: obj => obj.keySize, set: (obj, value) => { obj.keySize = value; } }, metadata: _metadata }, _keySize_initializers, _keySize_extraInitializers);
|
|
70
|
+
__esDecorate(this, null, _valueSize_decorators, { kind: "accessor", name: "valueSize", static: false, private: false, access: { has: obj => "valueSize" in obj, get: obj => obj.valueSize, set: (obj, value) => { obj.valueSize = value; } }, metadata: _metadata }, _valueSize_initializers, _valueSize_extraInitializers);
|
|
71
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
72
|
+
Attribute = _classThis = _classDescriptor.value;
|
|
73
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
74
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
75
|
+
}
|
|
76
|
+
#keySize_accessor_storage = __runInitializers(this, _keySize_initializers, void 0);
|
|
77
|
+
get keySize() { return this.#keySize_accessor_storage; }
|
|
78
|
+
set keySize(value) { this.#keySize_accessor_storage = value; }
|
|
79
|
+
#valueSize_accessor_storage = (__runInitializers(this, _keySize_extraInitializers), __runInitializers(this, _valueSize_initializers, void 0));
|
|
80
|
+
get valueSize() { return this.#valueSize_accessor_storage; }
|
|
81
|
+
set valueSize(value) { this.#valueSize_accessor_storage = value; }
|
|
84
82
|
get name() {
|
|
85
83
|
return decodeUTF8(this.subarray(8, 8 + this.keySize));
|
|
86
84
|
}
|
|
@@ -110,26 +108,9 @@ let Attribute = (() => {
|
|
|
110
108
|
}
|
|
111
109
|
constructor() {
|
|
112
110
|
super(...arguments);
|
|
113
|
-
_Attribute_keySize_accessor_storage.set(this, __runInitializers(this, _keySize_initializers, void 0));
|
|
114
|
-
_Attribute_valueSize_accessor_storage.set(this, (__runInitializers(this, _keySize_extraInitializers), __runInitializers(this, _valueSize_initializers, void 0)));
|
|
115
111
|
__runInitializers(this, _valueSize_extraInitializers);
|
|
116
112
|
}
|
|
117
113
|
};
|
|
118
|
-
_Attribute_keySize_accessor_storage = new WeakMap();
|
|
119
|
-
_Attribute_valueSize_accessor_storage = new WeakMap();
|
|
120
|
-
__setFunctionName(_classThis, "Attribute");
|
|
121
|
-
(() => {
|
|
122
|
-
var _a;
|
|
123
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create((_a = _classSuper[Symbol.metadata]) !== null && _a !== void 0 ? _a : null) : void 0;
|
|
124
|
-
_keySize_decorators = [(_a = t).uint32.bind(_a)];
|
|
125
|
-
_valueSize_decorators = [(_b = t).uint32.bind(_b)];
|
|
126
|
-
__esDecorate(_classThis, null, _keySize_decorators, { kind: "accessor", name: "keySize", static: false, private: false, access: { has: obj => "keySize" in obj, get: obj => obj.keySize, set: (obj, value) => { obj.keySize = value; } }, metadata: _metadata }, _keySize_initializers, _keySize_extraInitializers);
|
|
127
|
-
__esDecorate(_classThis, null, _valueSize_decorators, { kind: "accessor", name: "valueSize", static: false, private: false, access: { has: obj => "valueSize" in obj, get: obj => obj.valueSize, set: (obj, value) => { obj.valueSize = value; } }, metadata: _metadata }, _valueSize_initializers, _valueSize_extraInitializers);
|
|
128
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
129
|
-
Attribute = _classThis = _classDescriptor.value;
|
|
130
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
131
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
132
|
-
})();
|
|
133
114
|
return Attribute = _classThis;
|
|
134
115
|
})();
|
|
135
116
|
/**
|
|
@@ -138,7 +119,6 @@ let Attribute = (() => {
|
|
|
138
119
|
* @internal
|
|
139
120
|
*/
|
|
140
121
|
let Attributes = (() => {
|
|
141
|
-
var _Attributes_size_accessor_storage;
|
|
142
122
|
var _a;
|
|
143
123
|
let _classDecorators = [struct(packed)];
|
|
144
124
|
let _classDescriptor;
|
|
@@ -148,9 +128,20 @@ let Attributes = (() => {
|
|
|
148
128
|
let _size_decorators;
|
|
149
129
|
let _size_initializers = [];
|
|
150
130
|
let _size_extraInitializers = [];
|
|
151
|
-
var Attributes =
|
|
152
|
-
|
|
153
|
-
|
|
131
|
+
var Attributes = class extends _classSuper {
|
|
132
|
+
static { _classThis = this; }
|
|
133
|
+
static {
|
|
134
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
135
|
+
_size_decorators = [(_a = t).uint32.bind(_a)];
|
|
136
|
+
__esDecorate(this, null, _size_decorators, { kind: "accessor", name: "size", static: false, private: false, access: { has: obj => "size" in obj, get: obj => obj.size, set: (obj, value) => { obj.size = value; } }, metadata: _metadata }, _size_initializers, _size_extraInitializers);
|
|
137
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
138
|
+
Attributes = _classThis = _classDescriptor.value;
|
|
139
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
140
|
+
}
|
|
141
|
+
static name = 'Attributes';
|
|
142
|
+
#size_accessor_storage = __runInitializers(this, _size_initializers, void 0);
|
|
143
|
+
get size() { return this.#size_accessor_storage; }
|
|
144
|
+
set size(value) { this.#size_accessor_storage = value; }
|
|
154
145
|
get byteSize() {
|
|
155
146
|
let offset = this.byteOffset + sizeof(this);
|
|
156
147
|
for (let i = 0; i < this.size; i++) {
|
|
@@ -248,22 +239,12 @@ let Attributes = (() => {
|
|
|
248
239
|
}
|
|
249
240
|
constructor() {
|
|
250
241
|
super(...arguments);
|
|
251
|
-
_Attributes_size_accessor_storage.set(this, __runInitializers(this, _size_initializers, void 0));
|
|
252
242
|
__runInitializers(this, _size_extraInitializers);
|
|
253
243
|
}
|
|
244
|
+
static {
|
|
245
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
246
|
+
}
|
|
254
247
|
};
|
|
255
|
-
_Attributes_size_accessor_storage = new WeakMap();
|
|
256
|
-
__setFunctionName(_classThis, "Attributes");
|
|
257
|
-
(() => {
|
|
258
|
-
var _a;
|
|
259
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create((_a = _classSuper[Symbol.metadata]) !== null && _a !== void 0 ? _a : null) : void 0;
|
|
260
|
-
_size_decorators = [(_a = t).uint32.bind(_a)];
|
|
261
|
-
__esDecorate(_classThis, null, _size_decorators, { kind: "accessor", name: "size", static: false, private: false, access: { has: obj => "size" in obj, get: obj => obj.size, set: (obj, value) => { obj.size = value; } }, metadata: _metadata }, _size_initializers, _size_extraInitializers);
|
|
262
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
263
|
-
Attributes = _classThis = _classDescriptor.value;
|
|
264
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
265
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
266
|
-
})();
|
|
267
248
|
return Attributes = _classThis;
|
|
268
249
|
})();
|
|
269
250
|
export { Attributes };
|
|
@@ -349,7 +330,6 @@ export const userModifiableFlags = 0x000380ff;
|
|
|
349
330
|
* @internal
|
|
350
331
|
*/
|
|
351
332
|
let Inode = (() => {
|
|
352
|
-
var _Inode_data_accessor_storage, _Inode___data_old_accessor_storage, _Inode_size_accessor_storage, _Inode_mode_accessor_storage, _Inode_nlink_accessor_storage, _Inode_uid_accessor_storage, _Inode_gid_accessor_storage, _Inode_atimeMs_accessor_storage, _Inode_birthtimeMs_accessor_storage, _Inode_mtimeMs_accessor_storage, _Inode_ctimeMs_accessor_storage, _Inode_ino_accessor_storage, _Inode___ino_old_accessor_storage, _Inode_flags_accessor_storage, _Inode___after_flags_accessor_storage, _Inode_version_accessor_storage, _Inode___padding_accessor_storage, _Inode_attributes_accessor_storage, _Inode___data_accessor_storage;
|
|
353
333
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
354
334
|
let _classDecorators = [struct(packed)];
|
|
355
335
|
let _classDescriptor;
|
|
@@ -413,7 +393,53 @@ let Inode = (() => {
|
|
|
413
393
|
let ___data_decorators;
|
|
414
394
|
let ___data_initializers = [];
|
|
415
395
|
let ___data_extraInitializers = [];
|
|
416
|
-
var Inode =
|
|
396
|
+
var Inode = class extends _classSuper {
|
|
397
|
+
static { _classThis = this; }
|
|
398
|
+
static {
|
|
399
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
400
|
+
_data_decorators = [(_a = t).uint32.bind(_a)];
|
|
401
|
+
___data_old_decorators = [(_b = t).uint32.bind(_b)];
|
|
402
|
+
_size_decorators = [(_c = t).uint32.bind(_c)];
|
|
403
|
+
_mode_decorators = [(_d = t).uint16.bind(_d)];
|
|
404
|
+
_nlink_decorators = [(_e = t).uint32.bind(_e)];
|
|
405
|
+
_uid_decorators = [(_f = t).uint32.bind(_f)];
|
|
406
|
+
_gid_decorators = [(_g = t).uint32.bind(_g)];
|
|
407
|
+
_atimeMs_decorators = [(_h = t).float64.bind(_h)];
|
|
408
|
+
_birthtimeMs_decorators = [(_j = t).float64.bind(_j)];
|
|
409
|
+
_mtimeMs_decorators = [(_k = t).float64.bind(_k)];
|
|
410
|
+
_ctimeMs_decorators = [(_l = t).float64.bind(_l)];
|
|
411
|
+
_ino_decorators = [(_m = t).uint32.bind(_m)];
|
|
412
|
+
___ino_old_decorators = [(_o = t).uint32.bind(_o)];
|
|
413
|
+
_flags_decorators = [(_p = t).uint32.bind(_p)];
|
|
414
|
+
___after_flags_decorators = [(_q = t).uint16.bind(_q)];
|
|
415
|
+
_version_decorators = [(_r = t).uint32.bind(_r)];
|
|
416
|
+
___padding_decorators = [t.uint8(48)];
|
|
417
|
+
_attributes_decorators = [field(Attributes)];
|
|
418
|
+
___data_decorators = [t.uint8(maxDynamicData)];
|
|
419
|
+
__esDecorate(this, null, _data_decorators, { kind: "accessor", name: "data", static: false, private: false, access: { has: obj => "data" in obj, get: obj => obj.data, set: (obj, value) => { obj.data = value; } }, metadata: _metadata }, _data_initializers, _data_extraInitializers);
|
|
420
|
+
__esDecorate(this, null, ___data_old_decorators, { kind: "accessor", name: "__data_old", static: false, private: false, access: { has: obj => "__data_old" in obj, get: obj => obj.__data_old, set: (obj, value) => { obj.__data_old = value; } }, metadata: _metadata }, ___data_old_initializers, ___data_old_extraInitializers);
|
|
421
|
+
__esDecorate(this, null, _size_decorators, { kind: "accessor", name: "size", static: false, private: false, access: { has: obj => "size" in obj, get: obj => obj.size, set: (obj, value) => { obj.size = value; } }, metadata: _metadata }, _size_initializers, _size_extraInitializers);
|
|
422
|
+
__esDecorate(this, null, _mode_decorators, { kind: "accessor", name: "mode", static: false, private: false, access: { has: obj => "mode" in obj, get: obj => obj.mode, set: (obj, value) => { obj.mode = value; } }, metadata: _metadata }, _mode_initializers, _mode_extraInitializers);
|
|
423
|
+
__esDecorate(this, null, _nlink_decorators, { kind: "accessor", name: "nlink", static: false, private: false, access: { has: obj => "nlink" in obj, get: obj => obj.nlink, set: (obj, value) => { obj.nlink = value; } }, metadata: _metadata }, _nlink_initializers, _nlink_extraInitializers);
|
|
424
|
+
__esDecorate(this, null, _uid_decorators, { kind: "accessor", name: "uid", static: false, private: false, access: { has: obj => "uid" in obj, get: obj => obj.uid, set: (obj, value) => { obj.uid = value; } }, metadata: _metadata }, _uid_initializers, _uid_extraInitializers);
|
|
425
|
+
__esDecorate(this, null, _gid_decorators, { kind: "accessor", name: "gid", static: false, private: false, access: { has: obj => "gid" in obj, get: obj => obj.gid, set: (obj, value) => { obj.gid = value; } }, metadata: _metadata }, _gid_initializers, _gid_extraInitializers);
|
|
426
|
+
__esDecorate(this, null, _atimeMs_decorators, { kind: "accessor", name: "atimeMs", static: false, private: false, access: { has: obj => "atimeMs" in obj, get: obj => obj.atimeMs, set: (obj, value) => { obj.atimeMs = value; } }, metadata: _metadata }, _atimeMs_initializers, _atimeMs_extraInitializers);
|
|
427
|
+
__esDecorate(this, null, _birthtimeMs_decorators, { kind: "accessor", name: "birthtimeMs", static: false, private: false, access: { has: obj => "birthtimeMs" in obj, get: obj => obj.birthtimeMs, set: (obj, value) => { obj.birthtimeMs = value; } }, metadata: _metadata }, _birthtimeMs_initializers, _birthtimeMs_extraInitializers);
|
|
428
|
+
__esDecorate(this, null, _mtimeMs_decorators, { kind: "accessor", name: "mtimeMs", static: false, private: false, access: { has: obj => "mtimeMs" in obj, get: obj => obj.mtimeMs, set: (obj, value) => { obj.mtimeMs = value; } }, metadata: _metadata }, _mtimeMs_initializers, _mtimeMs_extraInitializers);
|
|
429
|
+
__esDecorate(this, null, _ctimeMs_decorators, { kind: "accessor", name: "ctimeMs", static: false, private: false, access: { has: obj => "ctimeMs" in obj, get: obj => obj.ctimeMs, set: (obj, value) => { obj.ctimeMs = value; } }, metadata: _metadata }, _ctimeMs_initializers, _ctimeMs_extraInitializers);
|
|
430
|
+
__esDecorate(this, null, _ino_decorators, { kind: "accessor", name: "ino", static: false, private: false, access: { has: obj => "ino" in obj, get: obj => obj.ino, set: (obj, value) => { obj.ino = value; } }, metadata: _metadata }, _ino_initializers, _ino_extraInitializers);
|
|
431
|
+
__esDecorate(this, null, ___ino_old_decorators, { kind: "accessor", name: "__ino_old", static: false, private: false, access: { has: obj => "__ino_old" in obj, get: obj => obj.__ino_old, set: (obj, value) => { obj.__ino_old = value; } }, metadata: _metadata }, ___ino_old_initializers, ___ino_old_extraInitializers);
|
|
432
|
+
__esDecorate(this, null, _flags_decorators, { kind: "accessor", name: "flags", static: false, private: false, access: { has: obj => "flags" in obj, get: obj => obj.flags, set: (obj, value) => { obj.flags = value; } }, metadata: _metadata }, _flags_initializers, _flags_extraInitializers);
|
|
433
|
+
__esDecorate(this, null, ___after_flags_decorators, { kind: "accessor", name: "__after_flags", static: false, private: false, access: { has: obj => "__after_flags" in obj, get: obj => obj.__after_flags, set: (obj, value) => { obj.__after_flags = value; } }, metadata: _metadata }, ___after_flags_initializers, ___after_flags_extraInitializers);
|
|
434
|
+
__esDecorate(this, null, _version_decorators, { kind: "accessor", name: "version", static: false, private: false, access: { has: obj => "version" in obj, get: obj => obj.version, set: (obj, value) => { obj.version = value; } }, metadata: _metadata }, _version_initializers, _version_extraInitializers);
|
|
435
|
+
__esDecorate(this, null, ___padding_decorators, { kind: "accessor", name: "__padding", static: false, private: false, access: { has: obj => "__padding" in obj, get: obj => obj.__padding, set: (obj, value) => { obj.__padding = value; } }, metadata: _metadata }, ___padding_initializers, ___padding_extraInitializers);
|
|
436
|
+
__esDecorate(this, null, _attributes_decorators, { kind: "accessor", name: "attributes", static: false, private: false, access: { has: obj => "attributes" in obj, get: obj => obj.attributes, set: (obj, value) => { obj.attributes = value; } }, metadata: _metadata }, _attributes_initializers, _attributes_extraInitializers);
|
|
437
|
+
__esDecorate(this, null, ___data_decorators, { kind: "accessor", name: "__data", static: false, private: false, access: { has: obj => "__data" in obj, get: obj => obj.__data, set: (obj, value) => { obj.__data = value; } }, metadata: _metadata }, ___data_initializers, ___data_extraInitializers);
|
|
438
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
439
|
+
Inode = _classThis = _classDescriptor.value;
|
|
440
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
441
|
+
}
|
|
442
|
+
static name = 'Inode';
|
|
417
443
|
constructor(...args) {
|
|
418
444
|
let data = {};
|
|
419
445
|
if (typeof args[0] === 'object' && args[0] !== null && !ArrayBuffer.isView(args[0])) {
|
|
@@ -421,98 +447,98 @@ let Inode = (() => {
|
|
|
421
447
|
args = [sizeof(Inode)];
|
|
422
448
|
}
|
|
423
449
|
super(...args);
|
|
424
|
-
_Inode_data_accessor_storage.set(this, __runInitializers(this, _data_initializers, void 0));
|
|
425
|
-
_Inode___data_old_accessor_storage.set(this, (__runInitializers(this, _data_extraInitializers), __runInitializers(this, ___data_old_initializers, void 0)));
|
|
426
|
-
_Inode_size_accessor_storage.set(this, (__runInitializers(this, ___data_old_extraInitializers), __runInitializers(this, _size_initializers, void 0)));
|
|
427
|
-
_Inode_mode_accessor_storage.set(this, (__runInitializers(this, _size_extraInitializers), __runInitializers(this, _mode_initializers, void 0)));
|
|
428
|
-
_Inode_nlink_accessor_storage.set(this, (__runInitializers(this, _mode_extraInitializers), __runInitializers(this, _nlink_initializers, void 0)));
|
|
429
|
-
_Inode_uid_accessor_storage.set(this, (__runInitializers(this, _nlink_extraInitializers), __runInitializers(this, _uid_initializers, void 0)));
|
|
430
|
-
_Inode_gid_accessor_storage.set(this, (__runInitializers(this, _uid_extraInitializers), __runInitializers(this, _gid_initializers, void 0)));
|
|
431
|
-
_Inode_atimeMs_accessor_storage.set(this, (__runInitializers(this, _gid_extraInitializers), __runInitializers(this, _atimeMs_initializers, void 0)));
|
|
432
|
-
_Inode_birthtimeMs_accessor_storage.set(this, (__runInitializers(this, _atimeMs_extraInitializers), __runInitializers(this, _birthtimeMs_initializers, void 0)));
|
|
433
|
-
_Inode_mtimeMs_accessor_storage.set(this, (__runInitializers(this, _birthtimeMs_extraInitializers), __runInitializers(this, _mtimeMs_initializers, void 0)));
|
|
434
|
-
_Inode_ctimeMs_accessor_storage.set(this, (__runInitializers(this, _mtimeMs_extraInitializers), __runInitializers(this, _ctimeMs_initializers, void 0)));
|
|
435
|
-
_Inode_ino_accessor_storage.set(this, (__runInitializers(this, _ctimeMs_extraInitializers), __runInitializers(this, _ino_initializers, void 0)));
|
|
436
|
-
_Inode___ino_old_accessor_storage.set(this, (__runInitializers(this, _ino_extraInitializers), __runInitializers(this, ___ino_old_initializers, void 0)));
|
|
437
|
-
_Inode_flags_accessor_storage.set(this, (__runInitializers(this, ___ino_old_extraInitializers), __runInitializers(this, _flags_initializers, void 0)));
|
|
438
|
-
_Inode___after_flags_accessor_storage.set(this, (__runInitializers(this, _flags_extraInitializers), __runInitializers(this, ___after_flags_initializers, void 0)));
|
|
439
|
-
_Inode_version_accessor_storage.set(this, (__runInitializers(this, ___after_flags_extraInitializers), __runInitializers(this, _version_initializers, void 0)));
|
|
440
|
-
_Inode___padding_accessor_storage.set(this, (__runInitializers(this, _version_extraInitializers), __runInitializers(this, ___padding_initializers, void 0)));
|
|
441
|
-
_Inode_attributes_accessor_storage.set(this, (__runInitializers(this, ___padding_extraInitializers), __runInitializers(this, _attributes_initializers, void 0)));
|
|
442
|
-
_Inode___data_accessor_storage.set(this, (__runInitializers(this, _attributes_extraInitializers), __runInitializers(this, ___data_initializers, void 0)));
|
|
443
450
|
__runInitializers(this, ___data_extraInitializers);
|
|
444
451
|
if (this.byteLength < sizeof(Inode)) {
|
|
445
452
|
throw crit(withErrno('EIO', `Buffer is too small to create an inode (${this.byteLength} bytes)`));
|
|
446
453
|
}
|
|
447
454
|
Object.assign(this, data);
|
|
448
|
-
this.atimeMs
|
|
449
|
-
this.mtimeMs
|
|
450
|
-
this.ctimeMs
|
|
451
|
-
this.birthtimeMs
|
|
455
|
+
this.atimeMs ||= Date.now();
|
|
456
|
+
this.mtimeMs ||= Date.now();
|
|
457
|
+
this.ctimeMs ||= Date.now();
|
|
458
|
+
this.birthtimeMs ||= Date.now();
|
|
452
459
|
if (this.ino && !this.nlink) {
|
|
453
460
|
warn(`Inode ${this.ino} has an nlink of 0`);
|
|
454
461
|
}
|
|
455
462
|
}
|
|
456
|
-
|
|
457
|
-
|
|
463
|
+
#data_accessor_storage = __runInitializers(this, _data_initializers, void 0);
|
|
464
|
+
get data() { return this.#data_accessor_storage; }
|
|
465
|
+
set data(value) { this.#data_accessor_storage = value; }
|
|
466
|
+
#__data_old_accessor_storage = (__runInitializers(this, _data_extraInitializers), __runInitializers(this, ___data_old_initializers, void 0));
|
|
458
467
|
/** For future use */
|
|
459
|
-
get __data_old() { return
|
|
460
|
-
set __data_old(value) {
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
get
|
|
466
|
-
set
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
get
|
|
472
|
-
set
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
468
|
+
get __data_old() { return this.#__data_old_accessor_storage; }
|
|
469
|
+
set __data_old(value) { this.#__data_old_accessor_storage = value; }
|
|
470
|
+
#size_accessor_storage = (__runInitializers(this, ___data_old_extraInitializers), __runInitializers(this, _size_initializers, void 0));
|
|
471
|
+
get size() { return this.#size_accessor_storage; }
|
|
472
|
+
set size(value) { this.#size_accessor_storage = value; }
|
|
473
|
+
#mode_accessor_storage = (__runInitializers(this, _size_extraInitializers), __runInitializers(this, _mode_initializers, void 0));
|
|
474
|
+
get mode() { return this.#mode_accessor_storage; }
|
|
475
|
+
set mode(value) { this.#mode_accessor_storage = value; }
|
|
476
|
+
#nlink_accessor_storage = (__runInitializers(this, _mode_extraInitializers), __runInitializers(this, _nlink_initializers, void 0));
|
|
477
|
+
get nlink() { return this.#nlink_accessor_storage; }
|
|
478
|
+
set nlink(value) { this.#nlink_accessor_storage = value; }
|
|
479
|
+
#uid_accessor_storage = (__runInitializers(this, _nlink_extraInitializers), __runInitializers(this, _uid_initializers, void 0));
|
|
480
|
+
get uid() { return this.#uid_accessor_storage; }
|
|
481
|
+
set uid(value) { this.#uid_accessor_storage = value; }
|
|
482
|
+
#gid_accessor_storage = (__runInitializers(this, _uid_extraInitializers), __runInitializers(this, _gid_initializers, void 0));
|
|
483
|
+
get gid() { return this.#gid_accessor_storage; }
|
|
484
|
+
set gid(value) { this.#gid_accessor_storage = value; }
|
|
485
|
+
#atimeMs_accessor_storage = (__runInitializers(this, _gid_extraInitializers), __runInitializers(this, _atimeMs_initializers, void 0));
|
|
486
|
+
get atimeMs() { return this.#atimeMs_accessor_storage; }
|
|
487
|
+
set atimeMs(value) { this.#atimeMs_accessor_storage = value; }
|
|
488
|
+
#birthtimeMs_accessor_storage = (__runInitializers(this, _atimeMs_extraInitializers), __runInitializers(this, _birthtimeMs_initializers, void 0));
|
|
489
|
+
get birthtimeMs() { return this.#birthtimeMs_accessor_storage; }
|
|
490
|
+
set birthtimeMs(value) { this.#birthtimeMs_accessor_storage = value; }
|
|
491
|
+
#mtimeMs_accessor_storage = (__runInitializers(this, _birthtimeMs_extraInitializers), __runInitializers(this, _mtimeMs_initializers, void 0));
|
|
492
|
+
get mtimeMs() { return this.#mtimeMs_accessor_storage; }
|
|
493
|
+
set mtimeMs(value) { this.#mtimeMs_accessor_storage = value; }
|
|
494
|
+
#ctimeMs_accessor_storage = (__runInitializers(this, _mtimeMs_extraInitializers), __runInitializers(this, _ctimeMs_initializers, void 0));
|
|
477
495
|
/**
|
|
478
496
|
* The time the inode was changed.
|
|
479
497
|
*
|
|
480
498
|
* This is automatically updated whenever changed are made using `update()`.
|
|
481
499
|
*/
|
|
482
|
-
get ctimeMs() { return
|
|
483
|
-
set ctimeMs(value) {
|
|
484
|
-
|
|
485
|
-
|
|
500
|
+
get ctimeMs() { return this.#ctimeMs_accessor_storage; }
|
|
501
|
+
set ctimeMs(value) { this.#ctimeMs_accessor_storage = value; }
|
|
502
|
+
#ino_accessor_storage = (__runInitializers(this, _ctimeMs_extraInitializers), __runInitializers(this, _ino_initializers, void 0));
|
|
503
|
+
get ino() { return this.#ino_accessor_storage; }
|
|
504
|
+
set ino(value) { this.#ino_accessor_storage = value; }
|
|
505
|
+
#__ino_old_accessor_storage = (__runInitializers(this, _ino_extraInitializers), __runInitializers(this, ___ino_old_initializers, void 0));
|
|
486
506
|
/** For future use */
|
|
487
|
-
get __ino_old() { return
|
|
488
|
-
set __ino_old(value) {
|
|
489
|
-
|
|
490
|
-
|
|
507
|
+
get __ino_old() { return this.#__ino_old_accessor_storage; }
|
|
508
|
+
set __ino_old(value) { this.#__ino_old_accessor_storage = value; }
|
|
509
|
+
#flags_accessor_storage = (__runInitializers(this, ___ino_old_extraInitializers), __runInitializers(this, _flags_initializers, void 0));
|
|
510
|
+
get flags() { return this.#flags_accessor_storage; }
|
|
511
|
+
set flags(value) { this.#flags_accessor_storage = value; }
|
|
512
|
+
#__after_flags_accessor_storage = (__runInitializers(this, _flags_extraInitializers), __runInitializers(this, ___after_flags_initializers, void 0));
|
|
491
513
|
/** For future use */
|
|
492
|
-
get __after_flags() { return
|
|
493
|
-
set __after_flags(value) {
|
|
514
|
+
get __after_flags() { return this.#__after_flags_accessor_storage; }
|
|
515
|
+
set __after_flags(value) { this.#__after_flags_accessor_storage = value; }
|
|
516
|
+
#version_accessor_storage = (__runInitializers(this, ___after_flags_extraInitializers), __runInitializers(this, _version_initializers, void 0));
|
|
494
517
|
/**
|
|
495
518
|
* The "version" of the inode/data.
|
|
496
519
|
* Unrelated to the inode format!
|
|
497
520
|
*/
|
|
498
|
-
get version() { return
|
|
499
|
-
set version(value) {
|
|
521
|
+
get version() { return this.#version_accessor_storage; }
|
|
522
|
+
set version(value) { this.#version_accessor_storage = value; }
|
|
523
|
+
#__padding_accessor_storage = (__runInitializers(this, _version_extraInitializers), __runInitializers(this, ___padding_initializers, void 0));
|
|
500
524
|
/**
|
|
501
525
|
* Padding up to 128 bytes.
|
|
502
526
|
* This ensures there is enough room for expansion without breaking the ABI.
|
|
503
527
|
* @internal
|
|
504
528
|
*/
|
|
505
|
-
get __padding() { return
|
|
506
|
-
set __padding(value) {
|
|
507
|
-
|
|
508
|
-
|
|
529
|
+
get __padding() { return this.#__padding_accessor_storage; }
|
|
530
|
+
set __padding(value) { this.#__padding_accessor_storage = value; }
|
|
531
|
+
#attributes_accessor_storage = (__runInitializers(this, ___padding_extraInitializers), __runInitializers(this, _attributes_initializers, void 0));
|
|
532
|
+
get attributes() { return this.#attributes_accessor_storage; }
|
|
533
|
+
set attributes(value) { this.#attributes_accessor_storage = value; }
|
|
534
|
+
#__data_accessor_storage = (__runInitializers(this, _attributes_extraInitializers), __runInitializers(this, ___data_initializers, void 0));
|
|
509
535
|
/**
|
|
510
536
|
* Since the attribute data uses dynamic arrays,
|
|
511
537
|
* it is necessary to add this so attributes can be added.
|
|
512
538
|
* @internal @hidden
|
|
513
539
|
*/
|
|
514
|
-
get __data() { return
|
|
515
|
-
set __data(value) {
|
|
540
|
+
get __data() { return this.#__data_accessor_storage; }
|
|
541
|
+
set __data(value) { this.#__data_accessor_storage = value; }
|
|
516
542
|
toString() {
|
|
517
543
|
return `<Inode ${this.ino}>`;
|
|
518
544
|
}
|
|
@@ -563,73 +589,10 @@ let Inode = (() => {
|
|
|
563
589
|
this.ctimeMs = Date.now();
|
|
564
590
|
return hasChanged;
|
|
565
591
|
}
|
|
592
|
+
static {
|
|
593
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
594
|
+
}
|
|
566
595
|
};
|
|
567
|
-
_Inode_data_accessor_storage = new WeakMap();
|
|
568
|
-
_Inode___data_old_accessor_storage = new WeakMap();
|
|
569
|
-
_Inode_size_accessor_storage = new WeakMap();
|
|
570
|
-
_Inode_mode_accessor_storage = new WeakMap();
|
|
571
|
-
_Inode_nlink_accessor_storage = new WeakMap();
|
|
572
|
-
_Inode_uid_accessor_storage = new WeakMap();
|
|
573
|
-
_Inode_gid_accessor_storage = new WeakMap();
|
|
574
|
-
_Inode_atimeMs_accessor_storage = new WeakMap();
|
|
575
|
-
_Inode_birthtimeMs_accessor_storage = new WeakMap();
|
|
576
|
-
_Inode_mtimeMs_accessor_storage = new WeakMap();
|
|
577
|
-
_Inode_ctimeMs_accessor_storage = new WeakMap();
|
|
578
|
-
_Inode_ino_accessor_storage = new WeakMap();
|
|
579
|
-
_Inode___ino_old_accessor_storage = new WeakMap();
|
|
580
|
-
_Inode_flags_accessor_storage = new WeakMap();
|
|
581
|
-
_Inode___after_flags_accessor_storage = new WeakMap();
|
|
582
|
-
_Inode_version_accessor_storage = new WeakMap();
|
|
583
|
-
_Inode___padding_accessor_storage = new WeakMap();
|
|
584
|
-
_Inode_attributes_accessor_storage = new WeakMap();
|
|
585
|
-
_Inode___data_accessor_storage = new WeakMap();
|
|
586
|
-
__setFunctionName(_classThis, "Inode");
|
|
587
|
-
(() => {
|
|
588
|
-
var _a;
|
|
589
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create((_a = _classSuper[Symbol.metadata]) !== null && _a !== void 0 ? _a : null) : void 0;
|
|
590
|
-
_data_decorators = [(_a = t).uint32.bind(_a)];
|
|
591
|
-
___data_old_decorators = [(_b = t).uint32.bind(_b)];
|
|
592
|
-
_size_decorators = [(_c = t).uint32.bind(_c)];
|
|
593
|
-
_mode_decorators = [(_d = t).uint16.bind(_d)];
|
|
594
|
-
_nlink_decorators = [(_e = t).uint32.bind(_e)];
|
|
595
|
-
_uid_decorators = [(_f = t).uint32.bind(_f)];
|
|
596
|
-
_gid_decorators = [(_g = t).uint32.bind(_g)];
|
|
597
|
-
_atimeMs_decorators = [(_h = t).float64.bind(_h)];
|
|
598
|
-
_birthtimeMs_decorators = [(_j = t).float64.bind(_j)];
|
|
599
|
-
_mtimeMs_decorators = [(_k = t).float64.bind(_k)];
|
|
600
|
-
_ctimeMs_decorators = [(_l = t).float64.bind(_l)];
|
|
601
|
-
_ino_decorators = [(_m = t).uint32.bind(_m)];
|
|
602
|
-
___ino_old_decorators = [(_o = t).uint32.bind(_o)];
|
|
603
|
-
_flags_decorators = [(_p = t).uint32.bind(_p)];
|
|
604
|
-
___after_flags_decorators = [(_q = t).uint16.bind(_q)];
|
|
605
|
-
_version_decorators = [(_r = t).uint32.bind(_r)];
|
|
606
|
-
___padding_decorators = [t.uint8(48)];
|
|
607
|
-
_attributes_decorators = [field(Attributes)];
|
|
608
|
-
___data_decorators = [t.uint8(maxDynamicData)];
|
|
609
|
-
__esDecorate(_classThis, null, _data_decorators, { kind: "accessor", name: "data", static: false, private: false, access: { has: obj => "data" in obj, get: obj => obj.data, set: (obj, value) => { obj.data = value; } }, metadata: _metadata }, _data_initializers, _data_extraInitializers);
|
|
610
|
-
__esDecorate(_classThis, null, ___data_old_decorators, { kind: "accessor", name: "__data_old", static: false, private: false, access: { has: obj => "__data_old" in obj, get: obj => obj.__data_old, set: (obj, value) => { obj.__data_old = value; } }, metadata: _metadata }, ___data_old_initializers, ___data_old_extraInitializers);
|
|
611
|
-
__esDecorate(_classThis, null, _size_decorators, { kind: "accessor", name: "size", static: false, private: false, access: { has: obj => "size" in obj, get: obj => obj.size, set: (obj, value) => { obj.size = value; } }, metadata: _metadata }, _size_initializers, _size_extraInitializers);
|
|
612
|
-
__esDecorate(_classThis, null, _mode_decorators, { kind: "accessor", name: "mode", static: false, private: false, access: { has: obj => "mode" in obj, get: obj => obj.mode, set: (obj, value) => { obj.mode = value; } }, metadata: _metadata }, _mode_initializers, _mode_extraInitializers);
|
|
613
|
-
__esDecorate(_classThis, null, _nlink_decorators, { kind: "accessor", name: "nlink", static: false, private: false, access: { has: obj => "nlink" in obj, get: obj => obj.nlink, set: (obj, value) => { obj.nlink = value; } }, metadata: _metadata }, _nlink_initializers, _nlink_extraInitializers);
|
|
614
|
-
__esDecorate(_classThis, null, _uid_decorators, { kind: "accessor", name: "uid", static: false, private: false, access: { has: obj => "uid" in obj, get: obj => obj.uid, set: (obj, value) => { obj.uid = value; } }, metadata: _metadata }, _uid_initializers, _uid_extraInitializers);
|
|
615
|
-
__esDecorate(_classThis, null, _gid_decorators, { kind: "accessor", name: "gid", static: false, private: false, access: { has: obj => "gid" in obj, get: obj => obj.gid, set: (obj, value) => { obj.gid = value; } }, metadata: _metadata }, _gid_initializers, _gid_extraInitializers);
|
|
616
|
-
__esDecorate(_classThis, null, _atimeMs_decorators, { kind: "accessor", name: "atimeMs", static: false, private: false, access: { has: obj => "atimeMs" in obj, get: obj => obj.atimeMs, set: (obj, value) => { obj.atimeMs = value; } }, metadata: _metadata }, _atimeMs_initializers, _atimeMs_extraInitializers);
|
|
617
|
-
__esDecorate(_classThis, null, _birthtimeMs_decorators, { kind: "accessor", name: "birthtimeMs", static: false, private: false, access: { has: obj => "birthtimeMs" in obj, get: obj => obj.birthtimeMs, set: (obj, value) => { obj.birthtimeMs = value; } }, metadata: _metadata }, _birthtimeMs_initializers, _birthtimeMs_extraInitializers);
|
|
618
|
-
__esDecorate(_classThis, null, _mtimeMs_decorators, { kind: "accessor", name: "mtimeMs", static: false, private: false, access: { has: obj => "mtimeMs" in obj, get: obj => obj.mtimeMs, set: (obj, value) => { obj.mtimeMs = value; } }, metadata: _metadata }, _mtimeMs_initializers, _mtimeMs_extraInitializers);
|
|
619
|
-
__esDecorate(_classThis, null, _ctimeMs_decorators, { kind: "accessor", name: "ctimeMs", static: false, private: false, access: { has: obj => "ctimeMs" in obj, get: obj => obj.ctimeMs, set: (obj, value) => { obj.ctimeMs = value; } }, metadata: _metadata }, _ctimeMs_initializers, _ctimeMs_extraInitializers);
|
|
620
|
-
__esDecorate(_classThis, null, _ino_decorators, { kind: "accessor", name: "ino", static: false, private: false, access: { has: obj => "ino" in obj, get: obj => obj.ino, set: (obj, value) => { obj.ino = value; } }, metadata: _metadata }, _ino_initializers, _ino_extraInitializers);
|
|
621
|
-
__esDecorate(_classThis, null, ___ino_old_decorators, { kind: "accessor", name: "__ino_old", static: false, private: false, access: { has: obj => "__ino_old" in obj, get: obj => obj.__ino_old, set: (obj, value) => { obj.__ino_old = value; } }, metadata: _metadata }, ___ino_old_initializers, ___ino_old_extraInitializers);
|
|
622
|
-
__esDecorate(_classThis, null, _flags_decorators, { kind: "accessor", name: "flags", static: false, private: false, access: { has: obj => "flags" in obj, get: obj => obj.flags, set: (obj, value) => { obj.flags = value; } }, metadata: _metadata }, _flags_initializers, _flags_extraInitializers);
|
|
623
|
-
__esDecorate(_classThis, null, ___after_flags_decorators, { kind: "accessor", name: "__after_flags", static: false, private: false, access: { has: obj => "__after_flags" in obj, get: obj => obj.__after_flags, set: (obj, value) => { obj.__after_flags = value; } }, metadata: _metadata }, ___after_flags_initializers, ___after_flags_extraInitializers);
|
|
624
|
-
__esDecorate(_classThis, null, _version_decorators, { kind: "accessor", name: "version", static: false, private: false, access: { has: obj => "version" in obj, get: obj => obj.version, set: (obj, value) => { obj.version = value; } }, metadata: _metadata }, _version_initializers, _version_extraInitializers);
|
|
625
|
-
__esDecorate(_classThis, null, ___padding_decorators, { kind: "accessor", name: "__padding", static: false, private: false, access: { has: obj => "__padding" in obj, get: obj => obj.__padding, set: (obj, value) => { obj.__padding = value; } }, metadata: _metadata }, ___padding_initializers, ___padding_extraInitializers);
|
|
626
|
-
__esDecorate(_classThis, null, _attributes_decorators, { kind: "accessor", name: "attributes", static: false, private: false, access: { has: obj => "attributes" in obj, get: obj => obj.attributes, set: (obj, value) => { obj.attributes = value; } }, metadata: _metadata }, _attributes_initializers, _attributes_extraInitializers);
|
|
627
|
-
__esDecorate(_classThis, null, ___data_decorators, { kind: "accessor", name: "__data", static: false, private: false, access: { has: obj => "__data" in obj, get: obj => obj.__data, set: (obj, value) => { obj.__data = value; } }, metadata: _metadata }, ___data_initializers, ___data_extraInitializers);
|
|
628
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
629
|
-
Inode = _classThis = _classDescriptor.value;
|
|
630
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
631
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
632
|
-
})();
|
|
633
596
|
return Inode = _classThis;
|
|
634
597
|
})();
|
|
635
598
|
export { Inode };
|
|
@@ -660,7 +623,7 @@ export function isFIFO(metadata) {
|
|
|
660
623
|
* @internal
|
|
661
624
|
*/
|
|
662
625
|
export function hasAccess($, inode, access) {
|
|
663
|
-
const credentials =
|
|
626
|
+
const credentials = $?.credentials || defaultContext.credentials;
|
|
664
627
|
if (isSymbolicLink(inode) || credentials.euid === 0 || credentials.egid === 0)
|
|
665
628
|
return true;
|
|
666
629
|
let perm = 0;
|