Skip to content

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

ParameterType
__namedParametersMemoryDirectoryOptions

Returns

MemoryFileSystem

Properties

PropertyModifierTypeDescriptionDefined in
listenersreadonlySet<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
treereadonlyTree-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

ParameterType
changeMemoryChange

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

ParameterType
partsreadonly string[]
entryMemoryNode

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

ParameterType
partsreadonly string[]
namestring
kindFileSystemHandleKind
createboolean

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

ParameterType
partsreadonly 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

ParameterType
partsreadonly string[]
kindFileSystemHandleKind

Returns

object

NameTypeDefined in
node| FileNode | DirectoryNodepackages/platform-fs-memory/src/handles.ts:136
placePlacepackages/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

ParameterType
partsreadonly string[]

Returns

SyncAccessFile


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

ParameterType
handleFileSystemHandle

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

ParameterType
partsreadonly string[]
namestring
recursiveboolean

Returns

void