Skip to content

SysFS

Defined in: src/fs/sysfs.ts:6

new SysFS(): SysFS

Defined in: src/fs/sysfs.ts:7

SysFS

KernelFS<KObject, Attribute, KLink>.constructor

protected _inodes: Map<string, Inode>

Defined in: src/fs/kernfs.ts:33

KernelFS._inodes


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

KernelFS._mountPoint


protected _nextIno: number = 1

Defined in: src/fs/kernfs.ts:31

KernelFS._nextIno


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

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

Internal

The UUID of the file system.

KernelFS._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

KernelFS.attributes


protected readonly enableFileSize: boolean = false

Defined in: src/fs/kernfs.ts:39

If set, statSync will get the actual file size

KernelFS.enableFileSize


protected readonly initTime: number

Defined in: src/fs/kernfs.ts:29

KernelFS.initTime


optional label?: string

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

KernelFS.label


protected lookup: (path) => KEntry | null = sysfs_lookup

Defined in: src/fs/sysfs.ts:11

Resolve a path to a node.

Resolve a sysfs path.

string

KEntry | null

null if nothing exists at path

ENOTDIR when part of path is used as a directory but isn’t a kobject

null or undefined when nothing is there

ENOTDIR when part of path is used as a directory but isn’t one

KernelFS.lookup


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

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

KernelFS.type

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

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

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

KernelFS.uuid

protected _forget(path): void

Defined in: src/fs/kernfs.ts:101

Forget the inode for path, and for everything that was under it

string

void

KernelFS._forget


protected _getInode(path, node): Inode

Defined in: src/fs/kernfs.ts:80

The inode for a path, made the first time it is asked for and kept so that the times and the inode number stay put across calls.

string

Attribute | KObject | KLink

Inode

KernelFS._getInode


protected _lookup(path): Attribute | KObject | KLink

Defined in: src/fs/kernfs.ts:58

Resolve a path to a node.

string

Attribute | KObject | KLink

ENOENT when nothing is there, ENOTDIR when part of the path isn’t a directory

KernelFS._lookup


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

KernelFS.createFile


createFileSync(_path, _options): InodeLike

Defined in: src/fs/kernfs.ts:151

Create the file at path with the given options.

string

CreationOptions

InodeLike

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

DevTmpFS.exists


existsSync(path): boolean

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

Test whether or not path exists.

string

boolean

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

KernelFS.ioctl


ioctlSync(context, command, …args): any

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

Internal

IoctlContext

number

…any[]

any

KernelFS.ioctlSync


protected is_dir(entry): entry is KObject

Defined in: src/fs/sysfs.ts:13

KEntry

entry is KObject

KernelFS.is_dir


protected is_link(entry): entry is KLink

Defined in: src/fs/sysfs.ts:17

KEntry

entry is KLink

KernelFS.is_link


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

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

string

string

Promise<void>

KernelFS.link


linkSync(): void

Defined in: src/fs/kernfs.ts:147

void

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

KernelFS.mkdir


mkdirSync(_path, _options): InodeLike

Defined in: src/fs/kernfs.ts:159

string

CreationOptions

InodeLike

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

KernelFS.read


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

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

string

Promise<string[]>

KernelFS.readdir


readdirSync(path): string[]

Defined in: src/fs/kernfs.ts:116

string

string[]

KernelFS.readdirSync


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

Defined in: src/fs/kernfs.ts:122

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

KernelFS.readSync


ready(): Promise<void>

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

Promise<void>

KernelFS.ready


readySync(): void

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

void

KernelFS.readySync


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

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

string

string

Promise<void>

KernelFS.rename


renameSync(): void

Defined in: src/fs/kernfs.ts:143

void

KernelFS.renameSync


abstract rmdir(path): Promise<void>

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

string

Promise<void>

KernelFS.rmdir


rmdirSync(_path): void

Defined in: src/fs/kernfs.ts:163

string

void

KernelFS.rmdirSync


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

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

string

Promise<InodeLike<number>>

KernelFS.stat


statSync(path): InodeLike

Defined in: src/fs/kernfs.ts:105

string

InodeLike

KernelFS.statSync


protected store(node, value): void

Defined in: src/fs/kernfs.ts:68

Take what was written to a node.

Attribute | KObject | KLink

string

void

EIO when there is nothing behind the file to take it

KernelFS.store


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

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

KernelFS.streamWrite


abstract sync(): Promise<void>

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

Promise<void>

KernelFS.sync


syncSync(): void

Defined in: src/fs/kernfs.ts:139

void

KernelFS.syncSync


toString(): string

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

string

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

KernelFS.touch


touchSync(path, metadata): void

Defined in: src/fs/kernfs.ts:112

Modify metadata.

string

Partial<InodeLike>

void

KernelFS.touchSync


abstract unlink(path): Promise<void>

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

string

Promise<void>

KernelFS.unlink


unlinkSync(_path): void

Defined in: src/fs/kernfs.ts:155

string

void

KernelFS.unlinkSync


usage(): UsageInfo

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

Default implementation.

UsageInfo

Implement

KernelFS.usage


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>

KernelFS.write


writeSync(path, buffer, offset): void

Defined in: src/fs/kernfs.ts:131

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

KernelFS.writeSync