Skip to content

StoreFS

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

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:324

T

StoreFS<T>

FileSystem.constructor

protected _initialized: boolean = false

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


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:324


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:257

Add a inode/path pair

number

string

void


_move(from, to): void

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

Move paths in the tables

string

string

void


_path(id): string | undefined

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

Gets the first path associated with an inode

number

string | undefined


_remove(ino): void

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

Remove a inode/path pair

number

void


protected allocNew(path): [number, number]

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

Allocates a new ID and adds the ID/path

string

[number, number]


checkRoot(): Promise<void>

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

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

Promise<void>


checkRootSync(): void

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

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:1083

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.

ArrayBufferView

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:1127

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.

ArrayBufferView

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:586

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:590

Create the file at path with the given options.

string

CreationOptions

Inode

FileSystem.createFileSync


createIndex(): Promise<Index>

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

Promise<Index>


createIndexSync(): Index

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

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:1036

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:1049

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:635

string

string

Promise<void>

FileSystem.link


linkSync(target, link): void

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

string

string

void

FileSystem.linkSync


loadIndex(index): Promise<void>

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

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:363

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:610

string

CreationOptions

Promise<Inode>

FileSystem.mkdir


mkdirSync(path, options): Inode

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

string

CreationOptions

Inode

FileSystem.mkdirSync


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

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

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:618

string

Promise<string[]>

FileSystem.readdir


readdirSync(path): string[]

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

string

string[]

FileSystem.readdirSync


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

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

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:300

Promise<void>

FileSystem.ready


readySync(): void

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

void

FileSystem.readySync


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

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

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:1208

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:437

string

string

Promise<void>

Make rename compatible with the cache.

FileSystem.rename


renameSync(oldPath, newPath): void

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

string

string

void

FileSystem.renameSync


rmdir(path): Promise<void>

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

string

Promise<void>

FileSystem.rmdir


rmdirSync(path): void

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

string

void

FileSystem.rmdirSync


stat(path): Promise<Inode>

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

string

Promise<Inode>

FileSystem.stat


statSync(path): Inode

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

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:630

Promise<void>

FileSystem.sync


syncSync(): void

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

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:548

Modify metadata.

string

Partial<InodeLike>

Promise<void>

FileSystem.touch


touchSync(path, metadata): void

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

Modify metadata.

string

Partial<InodeLike>

void

FileSystem.touchSync


unlink(path): Promise<void>

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

string

Promise<void>

FileSystem.unlink


unlinkSync(path): void

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

string

void

FileSystem.unlinkSync


usage(): UsageInfo

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

Default implementation.

UsageInfo

Implement

FileSystem.usage


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

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

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:724

Writes a buffer to a file

string

Uint8Array

number

The offset in the file to start writing

void

FileSystem.writeSync