StoreFS
Defined in: src/backends/store/fs.ts:233
Internal
A file system which uses a Store
Check modes?
Extends
Section titled “Extends”Extended by
Section titled “Extended by”Type Parameters
Section titled “Type Parameters”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new StoreFS<
T>(store):StoreFS<T>
Defined in: src/backends/store/fs.ts:324
Parameters
Section titled “Parameters”T
Returns
Section titled “Returns”StoreFS<T>
Overrides
Section titled “Overrides”Properties
Section titled “Properties”_initialized
Section titled “_initialized”
protected_initialized:boolean=false
Defined in: src/backends/store/fs.ts:298
_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”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:T
Defined in: src/backends/store/fs.ts:324
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:257
Add a inode/path pair
Parameters
Section titled “Parameters”number
string
Returns
Section titled “Returns”void
_move()
Section titled “_move()”_move(
from,to):void
Defined in: src/backends/store/fs.ts:275
Move paths in the tables
Parameters
Section titled “Parameters”string
string
Returns
Section titled “Returns”void
_path()
Section titled “_path()”_path(
id):string|undefined
Defined in: src/backends/store/fs.ts:249
Gets the first path associated with an inode
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”string | undefined
_remove()
Section titled “_remove()”_remove(
ino):void
Defined in: src/backends/store/fs.ts:265
Remove a inode/path pair
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
allocNew()
Section titled “allocNew()”
protectedallocNew(path): [number,number]
Defined in: src/backends/store/fs.ts:1059
Allocates a new ID and adds the ID/path
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”[number, number]
checkRoot()
Section titled “checkRoot()”checkRoot():
Promise<void>
Defined in: src/backends/store/fs.ts:764
Checks if the root directory exists. Creates it if it doesn’t.
Returns
Section titled “Returns”Promise<void>
checkRootSync()
Section titled “checkRootSync()”checkRootSync():
void
Defined in: src/backends/store/fs.ts:780
Checks if the root directory exists. Creates it if it doesn’t.
Returns
Section titled “Returns”void
commitNew()
Section titled “commitNew()”
protectedcommitNew(path,options,data):Promise<Inode>
Defined in: src/backends/store/fs.ts:1083
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.
ArrayBufferView
The data to store at the file’s data node.
Returns
Section titled “Returns”Promise<Inode>
commitNewSync()
Section titled “commitNewSync()”
protectedcommitNewSync(path,options,data):Inode
Defined in: src/backends/store/fs.ts:1127
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.
ArrayBufferView
The data to store at the file’s data node.
Returns
Section titled “Returns”The Inode for the new file.
createFile()
Section titled “createFile()”createFile(
path,options):Promise<Inode>
Defined in: src/backends/store/fs.ts:586
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/backends/store/fs.ts:590
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:377
Returns
Section titled “Returns”Promise<Index>
createIndexSync()
Section titled “createIndexSync()”createIndexSync():
Index
Defined in: src/backends/store/fs.ts:405
Returns
Section titled “Returns”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:1036
Finds the Inode of path.
Parameters
Section titled “Parameters”WrappedTransaction
string
The path to look up.
Returns
Section titled “Returns”Promise<Inode>
memoize/cache
findInodeSync()
Section titled “findInodeSync()”
protectedfindInodeSync(tx,path):Inode
Defined in: src/backends/store/fs.ts:1049
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
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/backends/store/fs.ts:635
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/backends/store/fs.ts:653
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:345
Load an index into the StoreFS. You must manually add non-directory files
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<void>
loadIndexSync()
Section titled “loadIndexSync()”loadIndexSync(
index):void
Defined in: src/backends/store/fs.ts:363
Load an index into the StoreFS. You must manually add non-directory files
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
mkdir()
Section titled “mkdir()”mkdir(
path,options):Promise<Inode>
Defined in: src/backends/store/fs.ts:610
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/backends/store/fs.ts:614
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/backends/store/fs.ts:670
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/backends/store/fs.ts:618
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/backends/store/fs.ts:624
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/backends/store/fs.ts:682
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:300
Returns
Section titled “Returns”Promise<void>
Overrides
Section titled “Overrides”readySync()
Section titled “readySync()”readySync():
void
Defined in: src/backends/store/fs.ts:312
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”remove()
Section titled “remove()”
protectedremove(path,isDir):Promise<void>
Defined in: src/backends/store/fs.ts:1169
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>
removeSync()
Section titled “removeSync()”
protectedremoveSync(path,isDir):void
Defined in: src/backends/store/fs.ts:1208
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
rename()
Section titled “rename()”rename(
oldPath,newPath):Promise<void>
Defined in: src/backends/store/fs.ts:437
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/backends/store/fs.ts:487
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/backends/store/fs.ts:602
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/backends/store/fs.ts:606
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/backends/store/fs.ts:537
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/backends/store/fs.ts:542
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/backends/store/fs.ts:630
Returns
Section titled “Returns”Promise<void>
Overrides
Section titled “Overrides”syncSync()
Section titled “syncSync()”syncSync():
void
Defined in: src/backends/store/fs.ts:632
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/backends/store/fs.ts:548
Modify metadata.
Parameters
Section titled “Parameters”string
metadata
Section titled “metadata”Partial<InodeLike>
Returns
Section titled “Returns”Promise<void>
Overrides
Section titled “Overrides”touchSync()
Section titled “touchSync()”touchSync(
path,metadata):void
Defined in: src/backends/store/fs.ts:567
Modify metadata.
Parameters
Section titled “Parameters”string
metadata
Section titled “metadata”Partial<InodeLike>
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”unlink()
Section titled “unlink()”unlink(
path):Promise<void>
Defined in: src/backends/store/fs.ts:594
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/backends/store/fs.ts:598
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:332
Default implementation.
Returns
Section titled “Returns”Implement
Overrides
Section titled “Overrides”write()
Section titled “write()”write(
path,data,offset):Promise<void>
Defined in: src/backends/store/fs.ts:695
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/backends/store/fs.ts:724
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