Class: MemoryFileSystem
Documentation / @wtf/platform-fs-memory / handles / MemoryFileSystem
Defined in: packages/platform-fs-memory/src/handles.ts:108
A file system in memory: its entries, its Tree, and the listeners each change of them is
told to, as it is made, by MemoryFileSystem.emit. Each handle of it reaches it as its
fileSystem.
Constructors
Constructor
new MemoryFileSystem(__namedParameters?): MemoryFileSystem;Defined in: packages/platform-fs-memory/src/handles.ts:114
A new file system, empty: of ignoreCase, and the time now stamps each change with.
Parameters
| Parameter | Type |
|---|---|
__namedParameters | MemoryDirectoryOptions |
Returns
MemoryFileSystem
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
listeners | readonly | Set<MemoryListener> | What is told of each change, as it is made: an observer of the file system adds itself. | packages/platform-fs-memory/src/handles.ts:111 |
tree | readonly | Tree | - | packages/platform-fs-memory/src/handles.ts:109 |
Methods
emit()
emit(change): void;Defined in: packages/platform-fs-memory/src/handles.ts:125
Each listener told of change.
Parameters
| Parameter | Type |
|---|---|
change | MemoryChange |
Returns
void
followed()
followed(parts, entry): MemoryNode | undefined;Defined in: packages/platform-fs-memory/src/handles.ts:149
The entry a link of parts leads to, or the entry; none where it leads to nothing.
Parameters
| Parameter | Type |
|---|---|
parts | readonly string[] |
entry | MemoryNode |
Returns
MemoryNode | undefined
getIn()
getIn( parts, name, kind, create): string[];Defined in: packages/platform-fs-memory/src/handles.ts:159
The entry of name in the folder of parts, found or made, of kind: its path.
Parameters
| Parameter | Type |
|---|---|
parts | readonly string[] |
name | string |
kind | FileSystemHandleKind |
create | boolean |
Returns
string[]
listIn()
listIn(parts): Generator<[string, FileSystemHandleKind]>;Defined in: packages/platform-fs-memory/src/handles.ts:201
Each entry of the folder of parts, by its name, of its kind: a link’s of what it leads to.
Parameters
| Parameter | Type |
|---|---|
parts | readonly string[] |
Returns
Generator<[string, FileSystemHandleKind]>
nodeOf()
nodeOf(parts, kind): object;Defined in: packages/platform-fs-memory/src/handles.ts:133
The entry of parts, of kind, and where it is: what is not there fails a NotFoundError,
and an entry of the other kind a TypeMismatchError.
Parameters
| Parameter | Type |
|---|---|
parts | readonly string[] |
kind | FileSystemHandleKind |
Returns
object
| Name | Type | Defined in |
|---|---|---|
node | | FileNode | DirectoryNode | packages/platform-fs-memory/src/handles.ts:136 |
place | Place | packages/platform-fs-memory/src/handles.ts:136 |
openFile()
openFile(parts): SyncAccessFile;Defined in: packages/platform-fs-memory/src/handles.ts:214
The file of parts, opened to read and write synchronously, held as a sync access handle holds
it until it closes: a file a writable or another sync access holds fails, a
NoModificationAllowedError. Each write and cut is a modified change of it.
Parameters
| Parameter | Type |
|---|---|
parts | readonly string[] |
Returns
pathOf()
pathOf(handle): readonly string[] | undefined;Defined in: packages/platform-fs-memory/src/handles.ts:119
The path of a handle of this file system, its names from the root; none of another’s.
Parameters
| Parameter | Type |
|---|---|
handle | FileSystemHandle |
Returns
readonly string[] | undefined
removeIn()
removeIn( parts, name, recursive): void;Defined in: packages/platform-fs-memory/src/handles.ts:185
Removes the entry of name from the folder of parts: a folder with what is in it, recursive.
Parameters
| Parameter | Type |
|---|---|
parts | readonly string[] |
name | string |
recursive | boolean |
Returns
void
