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

Allocates a new ID and adds the ID/path

string

number


checkRoot(): Promise<void>

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

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

Promise<void>


checkRootSync(): void

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

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

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

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

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

Create the file at path with the given options.

string

CreationOptions

Inode

FileSystem.createFileSync


createIndex(): Promise<Index>

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

Promise<Index>


createIndexSync(): Index

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

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

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

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

Internal

IoctlContext

number

any[]

Promise<any>

FileSystem.ioctl


ioctlSync(context, command, …args): any

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

Internal

IoctlContext

number

any[]

any

FileSystem.ioctlSync


link(target, link): Promise<void>

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

string

string

Promise<void>

FileSystem.link


linkSync(target, link): void

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

string

string

void

FileSystem.linkSync


loadIndex(index): Promise<void>

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

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

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

string

CreationOptions

Promise<Inode>

FileSystem.mkdir


mkdirSync(path, options): Inode

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

string

CreationOptions

Inode

FileSystem.mkdirSync


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

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

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

string

Promise<string[]>

FileSystem.readdir


readdirSync(path): string[]

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

string

string[]

FileSystem.readdirSync


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

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

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

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

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

string

string

Promise<void>

Make rename compatible with the cache.

FileSystem.rename


renameSync(oldPath, newPath): void

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

string

string

void

FileSystem.renameSync


rmdir(path): Promise<void>

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

string

Promise<void>

FileSystem.rmdir


rmdirSync(path): void

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

string

void

FileSystem.rmdirSync


stat(path): Promise<Inode>

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

string

Promise<Inode>

FileSystem.stat


statSync(path): Inode

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

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

Write a file using stream.

string

StreamOptions

WritableStream

FileSystem.streamWrite


sync(): Promise<void>

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

Updated the inode and data node at path

Promise<void>

FileSystem.sync


syncSync(): void

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

Updated the inode and data node at path

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

Modify metadata.

string

Partial<InodeLike>

Promise<void>

FileSystem.touch


touchSync(path, metadata): void

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

Modify metadata.

string

Partial<InodeLike>

void

FileSystem.touchSync


unlink(path): Promise<void>

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

string

Promise<void>

FileSystem.unlink


unlinkSync(path): void

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

string

void

FileSystem.unlinkSync


usage(): UsageInfo

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

UsageInfo

FileSystem.usage


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

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

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

Writes a buffer to a file

string

Uint8Array

number

The offset in the file to start writing

void

FileSystem.writeSync