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

T

StoreFS<T>

FileSystem.constructor

protected _initialized: boolean = false

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


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


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

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

Remove a inode/path pair

number

void


protected allocNew(path): number

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

Allocates a new ID and adds the ID/path

string

number


checkRoot(): Promise<void>

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

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

Promise<void>


checkRootSync(): void

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

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

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

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

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

Create the file at path with the given options.

string

CreationOptions

Inode

FileSystem.createFileSync


createIndex(): Promise<Index>

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

Promise<Index>


createIndexSync(): Index

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

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

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

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

string

string

Promise<void>

FileSystem.link


linkSync(target, link): void

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

string

string

void

FileSystem.linkSync


loadIndex(index): Promise<void>

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

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

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

string

CreationOptions

Promise<Inode>

FileSystem.mkdir


mkdirSync(path, options): Inode

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

string

CreationOptions

Inode

FileSystem.mkdirSync


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

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

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

string

Promise<string[]>

FileSystem.readdir


readdirSync(path): string[]

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

string

string[]

FileSystem.readdirSync


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

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

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

Promise<void>

FileSystem.ready


readySync(): void

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

void

FileSystem.readySync


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

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

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

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

string

string

Promise<void>

Make rename compatible with the cache.

FileSystem.rename


renameSync(oldPath, newPath): void

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

string

string

void

FileSystem.renameSync


rmdir(path): Promise<void>

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

string

Promise<void>

FileSystem.rmdir


rmdirSync(path): void

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

string

void

FileSystem.rmdirSync


stat(path): Promise<Inode>

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

string

Promise<Inode>

FileSystem.stat


statSync(path): Inode

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

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

Promise<void>

FileSystem.sync


syncSync(): void

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

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

Modify metadata.

string

Partial<InodeLike>

Promise<void>

FileSystem.touch


touchSync(path, metadata): void

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

Modify metadata.

string

Partial<InodeLike>

void

FileSystem.touchSync


unlink(path): Promise<void>

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

string

Promise<void>

FileSystem.unlink


unlinkSync(path): void

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

string

void

FileSystem.unlinkSync


usage(): UsageInfo

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

Default implementation.

UsageInfo

Implement

FileSystem.usage


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

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

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

Writes a buffer to a file

string

Uint8Array

number

The offset in the file to start writing

void

FileSystem.writeSync