Skip to content

EmscriptenFS

Defined in: src/backend.ts:29

Mounts an Emscripten file system into the ZenFS file system.

  • AsyncFSMethods<this> & FileSystem<this>

new EmscriptenFS(em): EmscriptenFS

Defined in: src/backend.ts:30

typeof FS

The Emscripten FS

EmscriptenFS

Sync(FileSystem).constructor

protected optional _mountPoint?: string

Defined in: node_modules/@zenfs/core/dist/internal/filesystem.d.ts:145

Internal

The last place this file system was mounted

Sync(FileSystem)._mountPoint


protected _uuid: UUID

Defined in: node_modules/@zenfs/core/dist/internal/filesystem.d.ts:151

Internal

The UUID of the file system.

Sync(FileSystem)._uuid


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

Defined in: node_modules/@zenfs/core/dist/internal/filesystem.d.ts:156

FileSystemAttributes

Sync(FileSystem).attributes


protected em: typeof FS

Defined in: src/backend.ts:34

The Emscripten FS


optional label?: string

Defined in: node_modules/@zenfs/core/dist/internal/filesystem.d.ts:140

Sync(FileSystem).label


readonly name: string

Defined in: node_modules/@zenfs/core/dist/internal/filesystem.d.ts:139

The name for this file system. For example, tmpfs for an in memory one

Sync(FileSystem).name


readonly type: number

Defined in: node_modules/@zenfs/core/dist/internal/filesystem.d.ts:134

A unique ID for this kind of file system. Currently unused internally, but could be used for partition tables or something

Sync(FileSystem).type

get uuid(): UUID

Defined in: node_modules/@zenfs/core/dist/internal/filesystem.d.ts:152

UUID

Sync(FileSystem).uuid

chmodSync(path, mode): void

Defined in: src/backend.ts:129

string

number

void


chownSync(path, new_uid, new_gid): void

Defined in: src/backend.ts:137

string

number

number

void


abstract createFile(path, options): Promise<InodeLike<number>>

Defined in: node_modules/@zenfs/core/dist/internal/filesystem.d.ts:188

Create the file at path with the given options.

string

CreationOptions

Promise<InodeLike<number>>

Sync(FileSystem).createFile


createFileSync(path, options): Inode

Defined in: src/backend.ts:76

Create the file at path with the given options.

string

CreationOptions

Inode

Sync(FileSystem).createFileSync


exists(path): Promise<boolean>

Defined in: node_modules/@zenfs/core/dist/internal/filesystem.d.ts:204

Test whether or not path exists.

string

Promise<boolean>

Sync(FileSystem).exists


existsSync(path): boolean

Defined in: node_modules/@zenfs/core/dist/internal/filesystem.d.ts:208

Test whether or not path exists.

string

boolean

Sync(FileSystem).existsSync


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

Defined in: node_modules/@zenfs/core/dist/internal/filesystem.d.ts:250

Internal

IoctlContext

number

…any[]

Promise<any>

Sync(FileSystem).ioctl


ioctlSync(context, command, …args): any

Defined in: node_modules/@zenfs/core/dist/internal/filesystem.d.ts:252

Internal

IoctlContext

number

…any[]

any

Sync(FileSystem).ioctlSync


abstract link(target, link): Promise<void>

Defined in: node_modules/@zenfs/core/dist/internal/filesystem.d.ts:209

string

string

Promise<void>

Sync(FileSystem).link


linkSync(srcpath, dstpath): void

Defined in: src/backend.ts:157

Right now this method is just a mask for symlinks

string

string

void

track hard links

Sync(FileSystem).linkSync


abstract mkdir(path, options): Promise<InodeLike<number>>

Defined in: node_modules/@zenfs/core/dist/internal/filesystem.d.ts:197

string

CreationOptions

Promise<InodeLike<number>>

Sync(FileSystem).mkdir


mkdirSync(path, options): Inode

Defined in: src/backend.ts:103

string

CreationOptions

Inode

Sync(FileSystem).mkdirSync


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

Defined in: node_modules/@zenfs/core/dist/internal/filesystem.d.ts:219

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>

Sync(FileSystem).read


abstract readdir(path): Promise<string[]>

Defined in: node_modules/@zenfs/core/dist/internal/filesystem.d.ts:199

string

Promise<string[]>

Sync(FileSystem).readdir


readdirSync(path): string[]

Defined in: src/backend.ts:112

string

string[]

Sync(FileSystem).readdirSync


readlinkSync(path): string

Defined in: src/backend.ts:165

string

string


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

Defined in: src/backend.ts:181

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

Sync(FileSystem).readSync


ready(): Promise<void>

Defined in: node_modules/@zenfs/core/dist/internal/filesystem.d.ts:175

Promise<void>

Sync(FileSystem).ready


readySync(): void

Defined in: node_modules/@zenfs/core/dist/internal/filesystem.d.ts:176

void

Sync(FileSystem).readySync


abstract rename(oldPath, newPath): Promise<void>

Defined in: node_modules/@zenfs/core/dist/internal/filesystem.d.ts:177

string

string

Promise<void>

Sync(FileSystem).rename


renameSync(oldPath, newPath): void

Defined in: src/backend.ts:53

string

string

void

Sync(FileSystem).renameSync


abstract rmdir(path): Promise<void>

Defined in: node_modules/@zenfs/core/dist/internal/filesystem.d.ts:195

string

Promise<void>

Sync(FileSystem).rmdir


rmdirSync(path): void

Defined in: src/backend.ts:95

string

void

Sync(FileSystem).rmdirSync


abstract stat(path): Promise<InodeLike<number>>

Defined in: node_modules/@zenfs/core/dist/internal/filesystem.d.ts:179

string

Promise<InodeLike<number>>

Sync(FileSystem).stat


statSync(path): Inode

Defined in: src/backend.ts:61

string

Inode

Sync(FileSystem).statSync


streamRead(path, options): ReadableStream

Defined in: node_modules/@zenfs/core/dist/internal/filesystem.d.ts:243

Read a file using a stream.

string

StreamOptions

ReadableStream

Sync(FileSystem).streamRead


streamWrite(path, options): WritableStream

Defined in: node_modules/@zenfs/core/dist/internal/filesystem.d.ts:248

Write a file using stream.

string

StreamOptions

WritableStream

Sync(FileSystem).streamWrite


symlinkSync(srcpath, dstpath): void

Defined in: src/backend.ts:145

string

string

void


abstract sync(): Promise<void>

Defined in: node_modules/@zenfs/core/dist/internal/filesystem.d.ts:211

Promise<void>

Sync(FileSystem).sync


syncSync(): void

Defined in: src/backend.ts:51

void

Sync(FileSystem).syncSync


toString(): string

Defined in: node_modules/@zenfs/core/dist/internal/filesystem.d.ts:168

string

Sync(FileSystem).toString


abstract touch(path, metadata): Promise<void>

Defined in: node_modules/@zenfs/core/dist/internal/filesystem.d.ts:182

Modify metadata.

string

Partial<InodeLike>

Promise<void>

Sync(FileSystem).touch


touchSync(path, inode): void

Defined in: src/backend.ts:40

Modify metadata.

string

Partial<InodeLike>

void

Sync(FileSystem).touchSync


truncateSync(path, len): void

Defined in: src/backend.ts:121

string

number

void


abstract unlink(path): Promise<void>

Defined in: node_modules/@zenfs/core/dist/internal/filesystem.d.ts:193

string

Promise<void>

Sync(FileSystem).unlink


unlinkSync(path): void

Defined in: src/backend.ts:87

string

void

Sync(FileSystem).unlinkSync


usage(): UsageInfo

Defined in: node_modules/@zenfs/core/dist/internal/filesystem.d.ts:174

Default implementation.

UsageInfo

Implement

Sync(FileSystem).usage


utimesSync(path, atime, mtime): void

Defined in: src/backend.ts:173

string

number

number

void


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

Defined in: node_modules/@zenfs/core/dist/internal/filesystem.d.ts:232

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>

Sync(FileSystem).write


writeSync(path, buffer, offset): void

Defined in: src/backend.ts:190

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

Sync(FileSystem).writeSync