Skip to content

DeviceFS

Defined in: src/internal/devices.ts:116

A temporary file system that manages and interfaces with devices

new DeviceFS(): DeviceFS

Defined in: src/internal/devices.ts:180

DeviceFS

StoreFS.constructor

protected _initialized: boolean = false

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

StoreFS._initialized


protected optional _mountPoint?: string

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

Internal

The last place this file system was mounted

StoreFS._mountPoint


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

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

Internal

The UUID of the file system.

StoreFS._uuid


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

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

FileSystemAttributes

StoreFS.attributes


protected readonly devices: Map<string, Device<any>>

Defined in: src/internal/devices.ts:117


optional label?: string

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

StoreFS.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

StoreFS.name


protected readonly store: InMemoryStore

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

StoreFS.store


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

StoreFS.type

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

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

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

StoreFS.uuid

_add(ino, path): void

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

Add a inode/path pair

number

string

void

StoreFS._add


_createDevice<TData>(driver, options?): Device<TData | Record<string, never>>

Defined in: src/internal/devices.ts:138

Internal

TData = any

DeviceDriver<TData>

object = {}

Device<TData | Record<string, never>>


_move(from, to): void

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

Move paths in the tables

string

string

void

StoreFS._move


_path(id): string | undefined

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

Gets the first path associated with an inode

number

string | undefined

StoreFS._path


_remove(ino): void

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

Remove a inode/path pair

number

void

StoreFS._remove


addDefaults(): void

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

Adds default devices

void


protected allocNew(path): number

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

Allocates a new ID and adds the ID/path

string

number

StoreFS.allocNew


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>

StoreFS.checkRoot


checkRootSync(): void

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

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

void

StoreFS.checkRootSync


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>

StoreFS.commitNew


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.

StoreFS.commitNewSync


createFile(path, options): Promise<Inode>

Defined in: src/internal/devices.ts:222

Create the file at path with the given options.

string

CreationOptions

Promise<Inode>

StoreFS.createFile


createFileSync(path, options): Inode

Defined in: src/internal/devices.ts:227

Create the file at path with the given options.

string

CreationOptions

Inode

StoreFS.createFileSync


createIndex(): Promise<Index>

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

Promise<Index>

StoreFS.createIndex


createIndexSync(): Index

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

Index

StoreFS.createIndexSync


protected devicesWithDriver(driver, forceIdentity?): Device<any>[]

Defined in: src/internal/devices.ts:119

string | DeviceDriver<unknown>

boolean

Device<any>[]


exists(path): Promise<boolean>

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

Test whether or not path exists.

string

Promise<boolean>

StoreFS.exists


existsSync(path): boolean

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

Test whether or not path exists.

string

boolean

StoreFS.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

StoreFS.findInode


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

StoreFS.findInodeSync


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

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

Internal

IoctlContext

number

any[]

Promise<any>

StoreFS.ioctl


ioctlSync(context, command, …args): any

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

Internal

IoctlContext

number

any[]

any

StoreFS.ioctlSync


link(target, link): Promise<void>

Defined in: src/internal/devices.ts:280

string

string

Promise<void>

StoreFS.link


linkSync(target, link): void

Defined in: src/internal/devices.ts:286

string

string

void

StoreFS.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>

StoreFS.loadIndex


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

StoreFS.loadIndexSync


mkdir(path, options): Promise<Inode>

Defined in: src/internal/devices.ts:250

string

CreationOptions

Promise<Inode>

StoreFS.mkdir


mkdirSync(path, options): Inode

Defined in: src/internal/devices.ts:255

string

CreationOptions

Inode

StoreFS.mkdirSync


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

Defined in: src/internal/devices.ts:306

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>

StoreFS.read


readdir(path): Promise<string[]>

Defined in: src/internal/devices.ts:260

string

Promise<string[]>

StoreFS.readdir


readdirSync(path): string[]

Defined in: src/internal/devices.ts:270

string

string[]

StoreFS.readdirSync


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

Defined in: src/internal/devices.ts:316

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

StoreFS.readSync


ready(): Promise<void>

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

Promise<void>

StoreFS.ready


readySync(): void

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

void

StoreFS.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>

StoreFS.remove


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

StoreFS.removeSync


rename(oldPath, newPath): Promise<void>

Defined in: src/internal/devices.ts:186

string

string

Promise<void>

Make rename compatible with the cache.

StoreFS.rename


renameSync(oldPath, newPath): void

Defined in: src/internal/devices.ts:192

string

string

void

StoreFS.renameSync


rmdir(path): Promise<void>

Defined in: src/internal/devices.ts:242

string

Promise<void>

StoreFS.rmdir


rmdirSync(path): void

Defined in: src/internal/devices.ts:246

string

void

StoreFS.rmdirSync


stat(path): Promise<Inode>

Defined in: src/internal/devices.ts:198

string

Promise<Inode>

StoreFS.stat


statSync(path): Inode

Defined in: src/internal/devices.ts:204

string

Inode

StoreFS.statSync


streamRead(path, options): ReadableStream

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

Read a file using a stream.

string

StreamOptions

ReadableStream

StoreFS.streamRead


streamWrite(path, options): WritableStream

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

Write a file using stream.

string

StreamOptions

WritableStream

StoreFS.streamWrite


sync(): Promise<void>

Defined in: src/internal/devices.ts:292

Updated the inode and data node at path

Promise<void>

StoreFS.sync


syncSync(): void

Defined in: src/internal/devices.ts:299

Updated the inode and data node at path

void

StoreFS.syncSync


toString(): string

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

string

StoreFS.toString


touch(path, metadata): Promise<void>

Defined in: src/internal/devices.ts:210

Modify metadata.

string

InodeLike

Promise<void>

StoreFS.touch


touchSync(path, metadata): void

Defined in: src/internal/devices.ts:216

Modify metadata.

string

InodeLike

void

StoreFS.touchSync


unlink(path): Promise<void>

Defined in: src/internal/devices.ts:232

string

Promise<void>

StoreFS.unlink


unlinkSync(path): void

Defined in: src/internal/devices.ts:237

string

void

StoreFS.unlinkSync


usage(): UsageInfo

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

UsageInfo

StoreFS.usage


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

Defined in: src/internal/devices.ts:326

Writes a buffer to a file

string

Uint8Array

number

The offset in the file to start writing

Promise<void>

StoreFS.write


writeSync(path, data, offset): void

Defined in: src/internal/devices.ts:335

Writes a buffer to a file

string

Uint8Array

number

The offset in the file to start writing

void

StoreFS.writeSync