Skip to content

IndexFS

Defined in: src/internal/index_fs.ts:24

Internal

A file system that uses an Index for metadata.

[breaking] replace the three method create system with something more intuitive, e.g. requiring subclasses to implement createFile, with this just exposing create for convenience.

new IndexFS(id, name, index?): IndexFS

Defined in: src/internal/index_fs.ts:25

number

string

Index = ...

IndexFS

FileSystem.constructor

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


readonly index: Index

Defined in: src/internal/index_fs.ts:28


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


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

protected optional _create(path, inode): Promise<void>

Defined in: src/internal/index_fs.ts:157

Create a new file in the underlying backend

string

Inode

Promise<void>


protected optional _createSync(path, inode): void

Defined in: src/internal/index_fs.ts:159

Create a new file in the underlying backend

string

Inode

void


protected optional _mkdir(path, options): Promise<void>

Defined in: src/internal/index_fs.ts:205

string

CreationOptions

Promise<void>


protected optional _mkdirSync(path, options): void

Defined in: src/internal/index_fs.ts:206

string

CreationOptions

void


protected _remove(path, isUnlink): void

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

string

boolean

void


protected create(path, options): Inode

Defined in: src/internal/index_fs.ts:161

string

CreationOptions

Inode


createFile(path, options): Promise<Inode>

Defined in: src/internal/index_fs.ts:183

Create the file at path with the given options.

string

CreationOptions

Promise<Inode>

FileSystem.createFile


createFileSync(path, options): Inode

Defined in: src/internal/index_fs.ts:194

Create the file at path with the given options.

string

CreationOptions

Inode

FileSystem.createFileSync


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


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(): Promise<void>

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

Promise<void>

FileSystem.link


linkSync(): void

Defined in: src/internal/index_fs.ts:226

void

FileSystem.linkSync


mkdir(path, options): Promise<Inode>

Defined in: src/internal/index_fs.ts:208

string

CreationOptions

Promise<Inode>

FileSystem.mkdir


mkdirSync(path, options): Inode

Defined in: src/internal/index_fs.ts:215

string

CreationOptions

Inode

FileSystem.mkdirSync


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

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

Reads into a buffer

string

Uint8Array

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

number

The offset into the file to start reading from

number

The position in the file to stop reading

Promise<void>

FileSystem.read


readdir(path): Promise<string[]>

Defined in: src/internal/index_fs.ts:230

string

Promise<string[]>

FileSystem.readdir


readdirSync(path): string[]

Defined in: src/internal/index_fs.ts:234

string

string[]

FileSystem.readdirSync


abstract readSync(path, buffer, start, end): void

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

Reads into a buffer

string

Uint8Array

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

number

The offset into the file to start reading from

number

The position in the file to stop reading

void

FileSystem.readSync


ready(): Promise<void>

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

Promise<void>

FileSystem.ready


readySync(): void

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

void

FileSystem.readySync


abstract protected remove(path): Promise<void>

Defined in: src/internal/index_fs.ts:128

string

Promise<void>


abstract protected removeSync(path): void

Defined in: src/internal/index_fs.ts:129

string

void


rename(oldPath, newPath): Promise<void>

Defined in: src/internal/index_fs.ts:55

string

string

Promise<void>

FileSystem.rename


renameSync(oldPath, newPath): void

Defined in: src/internal/index_fs.ts:76

string

string

void

FileSystem.renameSync


rmdir(path): Promise<void>

Defined in: src/internal/index_fs.ts:141

string

Promise<void>

FileSystem.rmdir


rmdirSync(path): void

Defined in: src/internal/index_fs.ts:149

string

void

FileSystem.rmdirSync


stat(path): Promise<Inode>

Defined in: src/internal/index_fs.ts:97

string

Promise<Inode>

FileSystem.stat


statSync(path): Inode

Defined in: src/internal/index_fs.ts:103

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/internal/index_fs.ts:238

Promise<void>

FileSystem.sync


syncSync(): void

Defined in: src/internal/index_fs.ts:240

void

FileSystem.syncSync


toString(): string

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

string

FileSystem.toString


touch(path, metadata): Promise<void>

Defined in: src/internal/index_fs.ts:109

Modify metadata.

string

InodeLike

Promise<void>

FileSystem.touch


touchSync(path, metadata): void

Defined in: src/internal/index_fs.ts:114

Modify metadata.

string

InodeLike

void

FileSystem.touchSync


unlink(path): Promise<void>

Defined in: src/internal/index_fs.ts:131

string

Promise<void>

FileSystem.unlink


unlinkSync(path): void

Defined in: src/internal/index_fs.ts:136

string

void

FileSystem.unlinkSync


usage(): UsageInfo

Defined in: src/internal/index_fs.ts:33

Default implementation.

UsageInfo

Implement

FileSystem.usage


abstract write(path, buffer, offset): Promise<void>

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

Writes a buffer to a file

string

Uint8Array

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

number

The offset in the file to start writing

Promise<void>

FileSystem.write


abstract writeSync(path, buffer, offset): void

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

Writes a buffer to a file

string

Uint8Array

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

number

The offset in the file to start writing

void

FileSystem.writeSync