@zenfs/core 2.3.4 → 2.3.5
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.
|
@@ -33,7 +33,15 @@ export declare class PassthroughFS extends FileSystem {
|
|
|
33
33
|
* Get file statistics synchronously.
|
|
34
34
|
*/
|
|
35
35
|
statSync(path: string): InodeLike;
|
|
36
|
+
/**
|
|
37
|
+
* @privateRemarks
|
|
38
|
+
* Timestamps should be updated by the underlying file system.
|
|
39
|
+
*/
|
|
36
40
|
touch(path: string, metadata: InodeLike): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* @privateRemarks
|
|
43
|
+
* Timestamps should be updated by the underlying file system.
|
|
44
|
+
*/
|
|
37
45
|
touchSync(path: string, metadata: InodeLike): void;
|
|
38
46
|
/**
|
|
39
47
|
* Unlink (delete) a file.
|
|
@@ -50,7 +50,7 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
|
|
|
50
50
|
var e = new Error(message);
|
|
51
51
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
52
52
|
});
|
|
53
|
-
import { warn } from 'kerium/log';
|
|
53
|
+
import { err, warn } from 'kerium/log';
|
|
54
54
|
import { FileSystem } from '../internal/filesystem.js';
|
|
55
55
|
import { isDirectory } from '../internal/inode.js';
|
|
56
56
|
import { resolve } from '../path.js';
|
|
@@ -96,13 +96,21 @@ export class PassthroughFS extends FileSystem {
|
|
|
96
96
|
statSync(path) {
|
|
97
97
|
return this.nodeFS.statSync(this.path(path));
|
|
98
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* @privateRemarks
|
|
101
|
+
* Timestamps should be updated by the underlying file system.
|
|
102
|
+
*/
|
|
99
103
|
async touch(path, metadata) {
|
|
100
104
|
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
101
105
|
try {
|
|
102
|
-
const handle = __addDisposableResource(env_1, await this.nodeFS.promises.open(this.path(path), '
|
|
106
|
+
const handle = __addDisposableResource(env_1, await this.nodeFS.promises.open(this.path(path), 'r'), true);
|
|
103
107
|
await handle.chmod(metadata.mode);
|
|
104
|
-
|
|
105
|
-
|
|
108
|
+
try {
|
|
109
|
+
await handle.chown(metadata.uid, metadata.gid);
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
err('Failed to chown passthrough file: ' + error.message);
|
|
113
|
+
}
|
|
106
114
|
}
|
|
107
115
|
catch (e_1) {
|
|
108
116
|
env_1.error = e_1;
|
|
@@ -114,10 +122,18 @@ export class PassthroughFS extends FileSystem {
|
|
|
114
122
|
await result_1;
|
|
115
123
|
}
|
|
116
124
|
}
|
|
125
|
+
/**
|
|
126
|
+
* @privateRemarks
|
|
127
|
+
* Timestamps should be updated by the underlying file system.
|
|
128
|
+
*/
|
|
117
129
|
touchSync(path, metadata) {
|
|
118
130
|
this.nodeFS.chmodSync(this.path(path), metadata.mode);
|
|
119
|
-
|
|
120
|
-
|
|
131
|
+
try {
|
|
132
|
+
this.nodeFS.chownSync(this.path(path), metadata.uid, metadata.gid);
|
|
133
|
+
}
|
|
134
|
+
catch (error) {
|
|
135
|
+
err('Failed to chown passthrough file: ' + error.message);
|
|
136
|
+
}
|
|
121
137
|
}
|
|
122
138
|
/**
|
|
123
139
|
* Unlink (delete) a file.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zenfs/core",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.5",
|
|
4
4
|
"description": "A filesystem, anywhere",
|
|
5
5
|
"funding": {
|
|
6
6
|
"type": "individual",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"eslint.shared.js"
|
|
27
27
|
],
|
|
28
28
|
"type": "module",
|
|
29
|
-
"homepage": "https://
|
|
29
|
+
"homepage": "https://zenfs.dev/core",
|
|
30
30
|
"author": "James Prevett <jp@jamespre.dev> (https://jamespre.dev)",
|
|
31
31
|
"contributors": [
|
|
32
32
|
"John Vilk <jvilk@cs.umass.edu>"
|