Skip to content

StoreFS

Defined in: src/backends/store/fs.ts:23

Internal

A file system which uses a Store

Check modes?

T extends Store = Store

new StoreFS<T>(store): StoreFS<T>

Defined in: src/backends/store/fs.ts:115

T

StoreFS<T>

FileSystem.constructor

protected _initialized: boolean = false

Defined in: src/backends/store/fs.ts:89


protected optional _mountPoint?: string

Defined in: src/internal/filesystem.ts:162

Internal

The last place this file system was mounted

FileSystem._mountPoint


protected _uuid: `${string}-${string}-${string}-${string}-${string}`

Defined in: src/internal/filesystem.ts:169

Internal

The UUID of the file system.

FileSystem._uuid


readonly attributes: ConstMap<FileSystemAttributes, keyof FileSystemAttributes, void | CaseFold | undefined> & Map<string, any>

Defined in: src/internal/filesystem.ts:178

FileSystemAttributes

FileSystem.attributes


optional label?: string

Defined in: src/internal/filesystem.ts:156

FileSystem.label


readonly name: string

Defined in: src/internal/filesystem.ts:191

The name for this file system. For example, tmpfs for an in memory one

FileSystem.name


protected readonly store: T

Defined in: src/backends/store/fs.ts:115


readonly type: number

Defined in: src/internal/filesystem.ts:185

A unique ID for this kind of file system. Currently unused internally, but could be used for partition tables or something

FileSystem.type

get uuid(): `${string}-${string}-${string}-${string}-${string}`

Defined in: src/internal/filesystem.ts:171

`${string}-${string}-${string}-${string}-${string}`

FileSystem.uuid

_add(ino, path): void

Defined in: src/backends/store/fs.ts:47

Add a inode/path pair

number

string

void


_move(from, to): void

Defined in: src/backends/store/fs.ts:66

Move paths in the tables

string

string

void


_path(id): string | undefined

Defined in: src/backends/store/fs.ts:39

Gets the first path associated with an inode

number

string | undefined


_remove(ino): void

Defined in: src/backends/store/fs.ts:56

Remove a inode/path pair

number

void


protected allocNew(path): number

Defined in: src/backends/store/fs.ts:767

Allocates a new ID and adds the ID/path

string

number


checkRoot(): Promise<void>

Defined in: src/backends/store/fs.ts:535

Checks if the root directory exists. Creates it if it doesn’t.

Promise<void>


checkRootSync(): void

Defined in: src/backends/store/fs.ts:550

Checks if the root directory exists. Creates it if it doesn’t.

void


protected commitNew(path, options, data): Promise<Inode>

Defined in: src/backends/store/fs.ts:784

Commits a new file (well, a FILE or a DIRECTORY) to the file system with mode. Note: This will commit the transaction.

string

The path to the new file.

CreationOptions

The options to create the new file with.

Uint8Array

The data to store at the file’s data node.

Promise<Inode>


protected commitNewSync(path, options, data): Inode

Defined in: src/backends/store/fs.ts:827

Commits a new file (well, a FILE or a DIRECTORY) to the file system with mode. Note: This will commit the transaction.

string

The path to the new file.

CreationOptions

The options to create the new file with.

Uint8Array

The data to store at the file’s data node.

Inode

The Inode for the new file.


createFile(path, options): Promise<Inode>

Defined in: src/backends/store/fs.ts:366

Create the file at path with the given options.

string

CreationOptions

Promise<Inode>

FileSystem.createFile


createFileSync(path, options): Inode

Defined in: src/backends/store/fs.ts:370

Create the file at path with the given options.

string

CreationOptions

Inode

FileSystem.createFileSync


createIndex(): Promise<Index>

Defined in: src/backends/store/fs.ts:168

Promise<Index>


createIndexSync(): Index

Defined in: src/backends/store/fs.ts:196

Index


exists(path): Promise<boolean>

Defined in: src/internal/filesystem.ts:257

Test whether or not path exists.

string

Promise<boolean>

FileSystem.exists


existsSync(path): boolean

Defined in: src/internal/filesystem.ts:269

Test whether or not path exists.

string

boolean

FileSystem.existsSync


protected findInode(tx, path): Promise<Inode>

Defined in: src/backends/store/fs.ts:744

Finds the Inode of path.

WrappedTransaction

string

The path to look up.

Promise<Inode>

memoize/cache


protected findInodeSync(tx, path): Inode

Defined in: src/backends/store/fs.ts:757

Finds the Inode of path.

WrappedTransaction

string

The path to look up.

Inode

The Inode of the path p.

memoize/cache


ioctl(context, command, …args): Promise<any>

Defined in: src/internal/filesystem.ts:365

Internal

IoctlContext

number

…any[]

Promise<any>

FileSystem.ioctl


ioctlSync(context, command, …args): any

Defined in: src/internal/filesystem.ts:373

Internal

IoctlContext

number

…any[]

any

FileSystem.ioctlSync


link(target, link): Promise<void>

Defined in: src/backends/store/fs.ts:416

string

string

Promise<void>

FileSystem.link


linkSync(target, link): void

Defined in: src/backends/store/fs.ts:434

string

string

void

FileSystem.linkSync


loadIndex(index): Promise<void>

Defined in: src/backends/store/fs.ts:136

Load an index into the StoreFS. You must manually add non-directory files

Index

Promise<void>


loadIndexSync(index): void

Defined in: src/backends/store/fs.ts:154

Load an index into the StoreFS. You must manually add non-directory files

Index

void


mkdir(path, options): Promise<Inode>

Defined in: src/backends/store/fs.ts:392

string

CreationOptions

Promise<Inode>

FileSystem.mkdir


mkdirSync(path, options): Inode

Defined in: src/backends/store/fs.ts:396

string

CreationOptions

Inode

FileSystem.mkdirSync


read(path, buffer, offset, end): Promise<void>

Defined in: src/backends/store/fs.ts:452

Reads into a buffer

string

Uint8Array

The buffer to read into. You must set the byteOffset and byteLength appropriately!

number

number

The position in the file to stop reading

Promise<void>

FileSystem.read


readdir(path): Promise<string[]>

Defined in: src/backends/store/fs.ts:400

string

Promise<string[]>

FileSystem.readdir


readdirSync(path): string[]

Defined in: src/backends/store/fs.ts:406

string

string[]

FileSystem.readdirSync


readSync(path, buffer, offset, end): void

Defined in: src/backends/store/fs.ts:464

Reads into a buffer

string

Uint8Array

The buffer to read into. You must set the byteOffset and byteLength appropriately!

number

number

The position in the file to stop reading

void

FileSystem.readSync


ready(): Promise<void>

Defined in: src/backends/store/fs.ts:91

Promise<void>

FileSystem.ready


readySync(): void

Defined in: src/backends/store/fs.ts:103

void

FileSystem.readySync


protected remove(path, isDir): Promise<void>

Defined in: src/backends/store/fs.ts:867

Remove all traces of path from the file system.

string

The path to remove from the file system.

boolean

Does the path belong to a directory, or a file?

Promise<void>


protected removeSync(path, isDir): void

Defined in: src/backends/store/fs.ts:903

Remove all traces of path from the file system.

string

The path to remove from the file system.

boolean

Does the path belong to a directory, or a file?

void


rename(oldPath, newPath): Promise<void>

Defined in: src/backends/store/fs.ts:227

string

string

Promise<void>

Make rename compatible with the cache.

FileSystem.rename


renameSync(oldPath, newPath): void

Defined in: src/backends/store/fs.ts:273

string

string

void

FileSystem.renameSync


rmdir(path): Promise<void>

Defined in: src/backends/store/fs.ts:382

string

Promise<void>

FileSystem.rmdir


rmdirSync(path): void

Defined in: src/backends/store/fs.ts:387

string

void

FileSystem.rmdirSync


stat(path): Promise<Inode>

Defined in: src/backends/store/fs.ts:319

string

Promise<Inode>

FileSystem.stat


statSync(path): Inode

Defined in: src/backends/store/fs.ts:324

string

Inode

FileSystem.statSync


streamRead(path, options): ReadableStream

Defined in: src/internal/filesystem.ts:317

Read a file using a stream.

string

StreamOptions

ReadableStream

FileSystem.streamRead


streamWrite(path, options): WritableStream

Defined in: src/internal/filesystem.ts:346

Write a file using stream.

string

StreamOptions

WritableStream

FileSystem.streamWrite


sync(): Promise<void>

Defined in: src/backends/store/fs.ts:412

Promise<void>

FileSystem.sync


syncSync(): void

Defined in: src/backends/store/fs.ts:414

void

FileSystem.syncSync


toString(): string

Defined in: src/internal/filesystem.ts:197

string

FileSystem.toString


touch(path, metadata): Promise<void>

Defined in: src/backends/store/fs.ts:329

Modify metadata.

string

Partial<InodeLike>

Promise<void>

FileSystem.touch


touchSync(path, metadata): void

Defined in: src/backends/store/fs.ts:347

Modify metadata.

string

Partial<InodeLike>

void

FileSystem.touchSync


unlink(path): Promise<void>

Defined in: src/backends/store/fs.ts:374

string

Promise<void>

FileSystem.unlink


unlinkSync(path): void

Defined in: src/backends/store/fs.ts:378

string

void

FileSystem.unlinkSync


usage(): UsageInfo

Defined in: src/backends/store/fs.ts:123

Default implementation.

UsageInfo

Implement

FileSystem.usage


write(path, data, offset): Promise<void>

Defined in: src/backends/store/fs.ts:476

Writes a buffer to a file

string

Uint8Array

number

The offset in the file to start writing

Promise<void>

FileSystem.write


writeSync(path, data, offset): void

Defined in: src/backends/store/fs.ts:500

Writes a buffer to a file

string

Uint8Array

number

The offset in the file to start writing

void

FileSystem.writeSync