DeviceFS
Defined in: src/internal/devices.ts:123
A temporary file system that manages and interfaces with devices
[breaking] remove
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new DeviceFS():
DeviceFS
Defined in: src/internal/devices.ts:187
Returns
Section titled “Returns”DeviceFS
Overrides
Section titled “Overrides”Properties
Section titled “Properties”_initialized
Section titled “_initialized”
protected_initialized:boolean=false
Defined in: src/backends/store/fs.ts:89
Inherited from
Section titled “Inherited from”_mountPoint?
Section titled “_mountPoint?”
protectedoptional_mountPoint?:string
Defined in: src/internal/filesystem.ts:162
Internal
The last place this file system was mounted
Inherited from
Section titled “Inherited from”
protected_uuid:`${string}-${string}-${string}-${string}-${string}`
Defined in: src/internal/filesystem.ts:169
Internal
The UUID of the file system.
Inherited from
Section titled “Inherited from”attributes
Section titled “attributes”
readonlyattributes:ConstMap<FileSystemAttributes, keyofFileSystemAttributes,void|CaseFold|undefined> &Map<string,any>
Defined in: src/internal/filesystem.ts:178
FileSystemAttributes
Inherited from
Section titled “Inherited from”devices
Section titled “devices”
protectedreadonlydevices:Map<string,Device<any>>
Defined in: src/internal/devices.ts:124
label?
Section titled “label?”
optionallabel?:string
Defined in: src/internal/filesystem.ts:156
Inherited from
Section titled “Inherited from”
readonlyname:string
Defined in: src/internal/filesystem.ts:191
The name for this file system. For example, tmpfs for an in memory one
Inherited from
Section titled “Inherited from”
protectedreadonlystore:InMemoryStore
Defined in: src/backends/store/fs.ts:115
Inherited from
Section titled “Inherited from”
readonlytype: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
Inherited from
Section titled “Inherited from”Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get uuid():
`${string}-${string}-${string}-${string}-${string}`
Defined in: src/internal/filesystem.ts:171
Returns
Section titled “Returns”`${string}-${string}-${string}-${string}-${string}`
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”_add()
Section titled “_add()”_add(
ino,path):void
Defined in: src/backends/store/fs.ts:47
Add a inode/path pair
Parameters
Section titled “Parameters”number
string
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”_createDevice()
Section titled “_createDevice()”_createDevice<
TData>(driver,options?):Device<TData|Record<string,never>>
Defined in: src/internal/devices.ts:145
Internal
Type Parameters
Section titled “Type Parameters”TData = any
Parameters
Section titled “Parameters”driver
Section titled “driver”DeviceDriver<TData>
options?
Section titled “options?”object = {}
Returns
Section titled “Returns”Device<TData | Record<string, never>>
_move()
Section titled “_move()”_move(
from,to):void
Defined in: src/backends/store/fs.ts:66
Move paths in the tables
Parameters
Section titled “Parameters”string
string
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”_path()
Section titled “_path()”_path(
id):string|undefined
Defined in: src/backends/store/fs.ts:39
Gets the first path associated with an inode
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”string | undefined
Inherited from
Section titled “Inherited from”_remove()
Section titled “_remove()”_remove(
ino):void
Defined in: src/backends/store/fs.ts:56
Remove a inode/path pair
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”addDefaults()
Section titled “addDefaults()”addDefaults():
void
Defined in: src/internal/devices.ts:178
Adds default devices
Returns
Section titled “Returns”void
allocNew()
Section titled “allocNew()”
protectedallocNew(path):number
Defined in: src/backends/store/fs.ts:767
Allocates a new ID and adds the ID/path
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”checkRoot()
Section titled “checkRoot()”checkRoot():
Promise<void>
Defined in: src/backends/store/fs.ts:535
Checks if the root directory exists. Creates it if it doesn’t.
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”checkRootSync()
Section titled “checkRootSync()”checkRootSync():
void
Defined in: src/backends/store/fs.ts:550
Checks if the root directory exists. Creates it if it doesn’t.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”commitNew()
Section titled “commitNew()”
protectedcommitNew(path,options,data):Promise<Inode>
Defined in: src/backends/store/fs.ts:784
Commits a new file (well, a FILE or a DIRECTORY) to the file system with mode.
Note: This will commit the transaction.
Parameters
Section titled “Parameters”string
The path to the new file.
options
Section titled “options”The options to create the new file with.
Uint8Array
The data to store at the file’s data node.
Returns
Section titled “Returns”Promise<Inode>
Inherited from
Section titled “Inherited from”commitNewSync()
Section titled “commitNewSync()”
protectedcommitNewSync(path,options,data):Inode
Defined in: src/backends/store/fs.ts:827
Commits a new file (well, a FILE or a DIRECTORY) to the file system with mode.
Note: This will commit the transaction.
Parameters
Section titled “Parameters”string
The path to the new file.
options
Section titled “options”The options to create the new file with.
Uint8Array
The data to store at the file’s data node.
Returns
Section titled “Returns”The Inode for the new file.
Inherited from
Section titled “Inherited from”createFile()
Section titled “createFile()”createFile(
path,options):Promise<Inode>
Defined in: src/internal/devices.ts:229
Create the file at path with the given options.
Parameters
Section titled “Parameters”string
options
Section titled “options”Returns
Section titled “Returns”Promise<Inode>
Overrides
Section titled “Overrides”createFileSync()
Section titled “createFileSync()”createFileSync(
path,options):Inode
Defined in: src/internal/devices.ts:234
Create the file at path with the given options.
Parameters
Section titled “Parameters”string
options
Section titled “options”Returns
Section titled “Returns”Overrides
Section titled “Overrides”createIndex()
Section titled “createIndex()”createIndex():
Promise<Index>
Defined in: src/backends/store/fs.ts:168
Returns
Section titled “Returns”Promise<Index>
Inherited from
Section titled “Inherited from”createIndexSync()
Section titled “createIndexSync()”createIndexSync():
Index
Defined in: src/backends/store/fs.ts:196
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”devicesWithDriver()
Section titled “devicesWithDriver()”
protecteddevicesWithDriver(driver,forceIdentity?):Device<any>[]
Defined in: src/internal/devices.ts:126
Parameters
Section titled “Parameters”driver
Section titled “driver”string | DeviceDriver<unknown>
forceIdentity?
Section titled “forceIdentity?”boolean
Returns
Section titled “Returns”Device<any>[]
exists()
Section titled “exists()”exists(
path):Promise<boolean>
Defined in: src/internal/filesystem.ts:257
Test whether or not path exists.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<boolean>
Inherited from
Section titled “Inherited from”existsSync()
Section titled “existsSync()”existsSync(
path):boolean
Defined in: src/internal/filesystem.ts:269
Test whether or not path exists.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”findInode()
Section titled “findInode()”
protectedfindInode(tx,path):Promise<Inode>
Defined in: src/backends/store/fs.ts:744
Finds the Inode of path.
Parameters
Section titled “Parameters”WrappedTransaction
string
The path to look up.
Returns
Section titled “Returns”Promise<Inode>
memoize/cache
Inherited from
Section titled “Inherited from”findInodeSync()
Section titled “findInodeSync()”
protectedfindInodeSync(tx,path):Inode
Defined in: src/backends/store/fs.ts:757
Finds the Inode of path.
Parameters
Section titled “Parameters”WrappedTransaction
string
The path to look up.
Returns
Section titled “Returns”The Inode of the path p.
memoize/cache
Inherited from
Section titled “Inherited from”ioctl()
Section titled “ioctl()”ioctl(
context,command, …args):Promise<any>
Defined in: src/internal/filesystem.ts:365
Internal
Parameters
Section titled “Parameters”context
Section titled “context”IoctlContext
command
Section titled “command”number
…any[]
Returns
Section titled “Returns”Promise<any>
Inherited from
Section titled “Inherited from”ioctlSync()
Section titled “ioctlSync()”ioctlSync(
context,command, …args):any
Defined in: src/internal/filesystem.ts:373
Internal
Parameters
Section titled “Parameters”context
Section titled “context”IoctlContext
command
Section titled “command”number
…any[]
Returns
Section titled “Returns”any
Inherited from
Section titled “Inherited from”link()
Section titled “link()”link(
target,link):Promise<void>
Defined in: src/internal/devices.ts:287
Parameters
Section titled “Parameters”target
Section titled “target”string
string
Returns
Section titled “Returns”Promise<void>
Overrides
Section titled “Overrides”linkSync()
Section titled “linkSync()”linkSync(
target,link):void
Defined in: src/internal/devices.ts:293
Parameters
Section titled “Parameters”target
Section titled “target”string
string
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”loadIndex()
Section titled “loadIndex()”loadIndex(
index):Promise<void>
Defined in: src/backends/store/fs.ts:136
Load an index into the StoreFS. You must manually add non-directory files
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”loadIndexSync()
Section titled “loadIndexSync()”loadIndexSync(
index):void
Defined in: src/backends/store/fs.ts:154
Load an index into the StoreFS. You must manually add non-directory files
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”mkdir()
Section titled “mkdir()”mkdir(
path,options):Promise<Inode>
Defined in: src/internal/devices.ts:257
Parameters
Section titled “Parameters”string
options
Section titled “options”Returns
Section titled “Returns”Promise<Inode>
Overrides
Section titled “Overrides”mkdirSync()
Section titled “mkdirSync()”mkdirSync(
path,options):Inode
Defined in: src/internal/devices.ts:262
Parameters
Section titled “Parameters”string
options
Section titled “options”Returns
Section titled “Returns”Overrides
Section titled “Overrides”read()
Section titled “read()”read(
path,buffer,offset,end):Promise<void>
Defined in: src/internal/devices.ts:313
Reads into a buffer
Parameters
Section titled “Parameters”string
buffer
Section titled “buffer”Uint8Array
The buffer to read into. You must set the byteOffset and byteLength appropriately!
offset
Section titled “offset”number
number
The position in the file to stop reading
Returns
Section titled “Returns”Promise<void>
Overrides
Section titled “Overrides”readdir()
Section titled “readdir()”readdir(
path):Promise<string[]>
Defined in: src/internal/devices.ts:267
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<string[]>
Overrides
Section titled “Overrides”readdirSync()
Section titled “readdirSync()”readdirSync(
path):string[]
Defined in: src/internal/devices.ts:277
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string[]
Overrides
Section titled “Overrides”readSync()
Section titled “readSync()”readSync(
path,buffer,offset,end):void
Defined in: src/internal/devices.ts:323
Reads into a buffer
Parameters
Section titled “Parameters”string
buffer
Section titled “buffer”Uint8Array
The buffer to read into. You must set the byteOffset and byteLength appropriately!
offset
Section titled “offset”number
number
The position in the file to stop reading
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”ready()
Section titled “ready()”ready():
Promise<void>
Defined in: src/backends/store/fs.ts:91
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”readySync()
Section titled “readySync()”readySync():
void
Defined in: src/backends/store/fs.ts:103
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”remove()
Section titled “remove()”
protectedremove(path,isDir):Promise<void>
Defined in: src/backends/store/fs.ts:867
Remove all traces of path from the file system.
Parameters
Section titled “Parameters”string
The path to remove from the file system.
boolean
Does the path belong to a directory, or a file?
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”removeSync()
Section titled “removeSync()”
protectedremoveSync(path,isDir):void
Defined in: src/backends/store/fs.ts:903
Remove all traces of path from the file system.
Parameters
Section titled “Parameters”string
The path to remove from the file system.
boolean
Does the path belong to a directory, or a file?
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”rename()
Section titled “rename()”rename(
oldPath,newPath):Promise<void>
Defined in: src/internal/devices.ts:193
Parameters
Section titled “Parameters”oldPath
Section titled “oldPath”string
newPath
Section titled “newPath”string
Returns
Section titled “Returns”Promise<void>
Make rename compatible with the cache.
Overrides
Section titled “Overrides”renameSync()
Section titled “renameSync()”renameSync(
oldPath,newPath):void
Defined in: src/internal/devices.ts:199
Parameters
Section titled “Parameters”oldPath
Section titled “oldPath”string
newPath
Section titled “newPath”string
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”rmdir()
Section titled “rmdir()”rmdir(
path):Promise<void>
Defined in: src/internal/devices.ts:249
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<void>
Overrides
Section titled “Overrides”rmdirSync()
Section titled “rmdirSync()”rmdirSync(
path):void
Defined in: src/internal/devices.ts:253
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”stat()
Section titled “stat()”stat(
path):Promise<Inode>
Defined in: src/internal/devices.ts:205
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<Inode>
Overrides
Section titled “Overrides”statSync()
Section titled “statSync()”statSync(
path):Inode
Defined in: src/internal/devices.ts:211
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Overrides
Section titled “Overrides”streamRead()
Section titled “streamRead()”streamRead(
path,options):ReadableStream
Defined in: src/internal/filesystem.ts:317
Read a file using a stream.
Parameters
Section titled “Parameters”string
options
Section titled “options”Returns
Section titled “Returns”ReadableStream
Inherited from
Section titled “Inherited from”streamWrite()
Section titled “streamWrite()”streamWrite(
path,options):WritableStream
Defined in: src/internal/filesystem.ts:346
Write a file using stream.
Parameters
Section titled “Parameters”string
options
Section titled “options”Returns
Section titled “Returns”WritableStream
Inherited from
Section titled “Inherited from”sync()
Section titled “sync()”sync():
Promise<void>
Defined in: src/internal/devices.ts:299
Returns
Section titled “Returns”Promise<void>
Overrides
Section titled “Overrides”syncSync()
Section titled “syncSync()”syncSync():
void
Defined in: src/internal/devices.ts:306
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”toString()
Section titled “toString()”toString():
string
Defined in: src/internal/filesystem.ts:197
Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”touch()
Section titled “touch()”touch(
path,metadata):Promise<void>
Defined in: src/internal/devices.ts:217
Modify metadata.
Parameters
Section titled “Parameters”string
metadata
Section titled “metadata”Returns
Section titled “Returns”Promise<void>
Overrides
Section titled “Overrides”touchSync()
Section titled “touchSync()”touchSync(
path,metadata):void
Defined in: src/internal/devices.ts:223
Modify metadata.
Parameters
Section titled “Parameters”string
metadata
Section titled “metadata”Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”unlink()
Section titled “unlink()”unlink(
path):Promise<void>
Defined in: src/internal/devices.ts:239
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<void>
Overrides
Section titled “Overrides”unlinkSync()
Section titled “unlinkSync()”unlinkSync(
path):void
Defined in: src/internal/devices.ts:244
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”usage()
Section titled “usage()”usage():
UsageInfo
Defined in: src/backends/store/fs.ts:123
Default implementation.
Returns
Section titled “Returns”Implement
Inherited from
Section titled “Inherited from”write()
Section titled “write()”write(
path,data,offset):Promise<void>
Defined in: src/internal/devices.ts:333
Writes a buffer to a file
Parameters
Section titled “Parameters”string
Uint8Array
offset
Section titled “offset”number
The offset in the file to start writing
Returns
Section titled “Returns”Promise<void>
Overrides
Section titled “Overrides”writeSync()
Section titled “writeSync()”writeSync(
path,data,offset):void
Defined in: src/internal/devices.ts:342
Writes a buffer to a file
Parameters
Section titled “Parameters”string
Uint8Array
offset
Section titled “offset”number
The offset in the file to start writing
Returns
Section titled “Returns”void