MCPcopy
hub / github.com/jvilk/BrowserFS / FileSystem

Interface FileSystem

src/core/file_system.ts:61–327  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59 * reset the JavaScript stack depth before calling the user-supplied callback.
60 */
61export interface FileSystem {
62 /**
63 * **Optional**: Returns the name of the file system.
64 */
65 getName(): string;
66 /**
67 * **Optional**: Passes the following information to the callback:
68 *
69 * * Total number of bytes available on this file system.
70 * * number of free bytes available on this file system.
71 *
72 * @todo This info is not available through the Node API. Perhaps we could do a
73 * polyfill of diskspace.js, or add a new Node API function.
74 * @param path The path to the location that is being queried. Only
75 * useful for filesystems that support mount points.
76 */
77 diskSpace(p: string, cb: (total: number, free: number) => any): void;
78 /**
79 * **Core**: Is this filesystem read-only?
80 * @return True if this FileSystem is inherently read-only.
81 */
82 isReadOnly(): boolean;
83 /**
84 * **Core**: Does the filesystem support optional symlink/hardlink-related
85 * commands?
86 * @return True if the FileSystem supports the optional
87 * symlink/hardlink-related commands.
88 */
89 supportsLinks(): boolean;
90 /**
91 * **Core**: Does the filesystem support optional property-related commands?
92 * @return True if the FileSystem supports the optional
93 * property-related commands (permissions, utimes, etc).
94 */
95 supportsProps(): boolean;
96 /**
97 * **Core**: Does the filesystem support the optional synchronous interface?
98 * @return True if the FileSystem supports synchronous operations.
99 */
100 supportsSynch(): boolean;
101 // **CORE API METHODS**
102 // File or directory operations
103 /**
104 * **Core**: Asynchronous rename. No arguments other than a possible exception
105 * are given to the completion callback.
106 */
107 rename(oldPath: string, newPath: string, cb: BFSOneArgCallback): void;
108 /**
109 * **Core**: Synchronous rename.
110 */
111 renameSync(oldPath: string, newPath: string): void;
112 /**
113 * **Core**: Asynchronous `stat` or `lstat`.
114 * @param isLstat True if this is `lstat`, false if this is regular
115 * `stat`.
116 */
117 stat(p: string, isLstat: boolean | null, cb: BFSCallback<Stats>): void;
118 /**

Callers 238

generateAllTestsFunction · 0.65
getNameMethod · 0.65
getNameMethod · 0.65
diskSpaceMethod · 0.65
rename-test.tsFile · 0.65
mode-test.tsFile · 0.65
node-fs-chmod.tsFile · 0.65
rmdir.tsFile · 0.65

Implementers 10

LockedFSsrc/generic/locked_fs.ts
MountableFileSystemsrc/backend/MountableFileSystem.ts
WorkerFSsrc/backend/WorkerFS.ts
IsoFSsrc/backend/IsoFS.ts
UnlockedOverlayFSsrc/backend/OverlayFS.ts
FolderAdaptersrc/backend/FolderAdapter.ts
ZipFSsrc/backend/ZipFS.ts
XmlHttpRequestsrc/backend/XmlHttpRequest.ts
AsyncMirrorsrc/backend/AsyncMirror.ts
DropboxFileSystemsrc/backend/Dropbox.ts

Calls

no outgoing calls

Tested by

no test coverage detected