PortFS
Defined in: src/backends/port.ts:39
Internal
PortFS lets you access an FS instance that is running in a port, or the other way around.
Note that direct synchronous operations are not permitted on the PortFS, regardless of the configuration option of the remote FS.
Extends
Section titled “Extends”AsyncMixin<this> &FileSystem<this>
Type Parameters
Section titled “Type Parameters”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new PortFS<
T>(channel,timeout?):PortFS<T>
Defined in: src/backends/port.ts:50
Constructs a new PortFS instance that connects with the FS running on options.port.
Parameters
Section titled “Parameters”channel
Section titled “channel”T
timeout?
Section titled “timeout?”number = 250
Returns
Section titled “Returns”PortFS<T>
Overrides
Section titled “Overrides”Async(FileSystem).constructor
Properties
Section titled “Properties”_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”Async(FileSystem)._mountPoint
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”Async(FileSystem)._uuid
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”Async(FileSystem).attributes
channel
Section titled “channel”
readonlychannel:T
Defined in: src/backends/port.ts:51
label?
Section titled “label?”
optionallabel?:string
Defined in: src/internal/filesystem.ts:156
Inherited from
Section titled “Inherited from”Async(FileSystem).label
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”Async(FileSystem).name
readonlyport:Port<T>
Defined in: src/backends/port.ts:40
timeout
Section titled “timeout”
readonlytimeout:number=250
Defined in: src/backends/port.ts:52
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”Async(FileSystem).type
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”Async(FileSystem).uuid
Methods
Section titled “Methods”createFile()
Section titled “createFile()”createFile(
path,options):Promise<Inode>
Defined in: src/backends/port.ts:91
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”Async(FileSystem).createFile
createFileSync()
Section titled “createFileSync()”
abstractcreateFileSync(path,options):InodeLike
Defined in: src/internal/filesystem.ts:238
Create the file at path with the given options.
Parameters
Section titled “Parameters”string
options
Section titled “options”Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”exists()
Section titled “exists()”exists(
path):Promise<boolean>
Defined in: src/backends/port.ts:115
Test whether or not path exists.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<boolean>
Overrides
Section titled “Overrides”Async(FileSystem).exists
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”Async(FileSystem).existsSync
ioctl()
Section titled “ioctl()”ioctl(
context,command, …args):Promise<any>
Defined in: src/internal/filesystem.ts:359
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”Async(FileSystem).ioctl
ioctlSync()
Section titled “ioctlSync()”ioctlSync(
context,command, …args):any
Defined in: src/internal/filesystem.ts:367
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(
srcpath,dstpath):Promise<void>
Defined in: src/backends/port.ts:119
Parameters
Section titled “Parameters”srcpath
Section titled “srcpath”string
dstpath
Section titled “dstpath”string
Returns
Section titled “Returns”Promise<void>
Overrides
Section titled “Overrides”Async(FileSystem).link
linkSync()
Section titled “linkSync()”
abstractlinkSync(target,link):void
Defined in: src/internal/filesystem.ts:279
Parameters
Section titled “Parameters”target
Section titled “target”string
string
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”mkdir()
Section titled “mkdir()”mkdir(
path,options):Promise<Inode>
Defined in: src/backends/port.ts:105
Parameters
Section titled “Parameters”string
options
Section titled “options”Returns
Section titled “Returns”Promise<Inode>
Overrides
Section titled “Overrides”Async(FileSystem).mkdir
mkdirSync()
Section titled “mkdirSync()”
abstractmkdirSync(path,options):InodeLike
Defined in: src/internal/filesystem.ts:249
Parameters
Section titled “Parameters”string
options
Section titled “options”Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”queueDone()
Section titled “queueDone()”queueDone():
Promise<void>
Defined in: src/mixins/async.ts:31
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”Async(FileSystem).queueDone
read()
Section titled “read()”read(
path,buffer,start,end):Promise<void>
Defined in: src/backends/port.ts:123
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!
number
The offset into the file to start reading from
number
The position in the file to stop reading
Returns
Section titled “Returns”Promise<void>
Overrides
Section titled “Overrides”Async(FileSystem).read
readdir()
Section titled “readdir()”readdir(
path):Promise<string[]>
Defined in: src/backends/port.ts:111
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<string[]>
Overrides
Section titled “Overrides”Async(FileSystem).readdir
readdirSync()
Section titled “readdirSync()”
abstractreaddirSync(path):string[]
Defined in: src/internal/filesystem.ts:252
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string[]
Inherited from
Section titled “Inherited from”readSync()
Section titled “readSync()”
abstractreadSync(path,buffer,start,end):void
Defined in: src/internal/filesystem.ts:297
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!
number
The offset into the file to start reading from
number
The position in the file to stop reading
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”ready()
Section titled “ready()”ready():
Promise<void>
Defined in: src/backends/port.ts:67
Returns
Section titled “Returns”Promise<void>
Overrides
Section titled “Overrides”readySync()
Section titled “readySync()”readySync():
void
Defined in: src/internal/filesystem.ts:214
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”rename()
Section titled “rename()”rename(
oldPath,newPath):Promise<void>
Defined in: src/backends/port.ts:72
Parameters
Section titled “Parameters”oldPath
Section titled “oldPath”string
newPath
Section titled “newPath”string
Returns
Section titled “Returns”Promise<void>
Overrides
Section titled “Overrides”Async(FileSystem).rename
renameSync()
Section titled “renameSync()”
abstractrenameSync(oldPath,newPath):void
Defined in: src/internal/filesystem.ts:219
Parameters
Section titled “Parameters”oldPath
Section titled “oldPath”string
newPath
Section titled “newPath”string
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”rmdir()
Section titled “rmdir()”rmdir(
path):Promise<void>
Defined in: src/backends/port.ts:101
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<void>
Overrides
Section titled “Overrides”Async(FileSystem).rmdir
rmdirSync()
Section titled “rmdirSync()”
abstractrmdirSync(path):void
Defined in: src/internal/filesystem.ts:246
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”
protectedrpc<T>(method, …args):Promise<Awaited<ReturnType<Methods[T]>>>
Defined in: src/backends/port.ts:59
Type Parameters
Section titled “Type Parameters”T extends keyof Methods
Parameters
Section titled “Parameters”method
Section titled “method”T
…Parameters<Methods[T]>
Returns
Section titled “Returns”Promise<Awaited<ReturnType<Methods[T]>>>
stat()
Section titled “stat()”stat(
path):Promise<Inode>
Defined in: src/backends/port.ts:76
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<Inode>
Overrides
Section titled “Overrides”Async(FileSystem).stat
statSync()
Section titled “statSync()”
abstractstatSync(path):InodeLike
Defined in: src/internal/filesystem.ts:222
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”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”Async(FileSystem).streamRead
streamWrite()
Section titled “streamWrite()”streamWrite(
path,options):WritableStream
Defined in: src/internal/filesystem.ts:340
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”Async(FileSystem).streamWrite
sync()
Section titled “sync()”sync():
Promise<void>
Defined in: src/backends/port.ts:86
Returns
Section titled “Returns”Promise<void>
Overrides
Section titled “Overrides”syncSync()
Section titled “syncSync()”
abstractsyncSync():void
Defined in: src/internal/filesystem.ts:282
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”toString()
Section titled “toString()”toString():
string
Defined in: src/internal/filesystem.ts:197
Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”Async(FileSystem).toString
touch()
Section titled “touch()”touch(
path,metadata):Promise<void>
Defined in: src/backends/port.ts:81
Modify metadata.
Parameters
Section titled “Parameters”string
metadata
Section titled “metadata”Returns
Section titled “Returns”Promise<void>
Overrides
Section titled “Overrides”Async(FileSystem).touch
touchSync()
Section titled “touchSync()”
abstracttouchSync(path,metadata):void
Defined in: src/internal/filesystem.ts:228
Modify metadata.
Parameters
Section titled “Parameters”string
metadata
Section titled “metadata”Partial<InodeLike>
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”unlink()
Section titled “unlink()”unlink(
path):Promise<void>
Defined in: src/backends/port.ts:97
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<void>
Overrides
Section titled “Overrides”Async(FileSystem).unlink
unlinkSync()
Section titled “unlinkSync()”
abstractunlinkSync(path):void
Defined in: src/internal/filesystem.ts:241
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”usage()
Section titled “usage()”usage():
UsageInfo
Defined in: src/internal/filesystem.ts:206
Default implementation.
Returns
Section titled “Returns”Implement
Inherited from
Section titled “Inherited from”Async(FileSystem).usage
write()
Section titled “write()”write(
path,buffer,offset):Promise<void>
Defined in: src/backends/port.ts:127
Writes a buffer to a file
Parameters
Section titled “Parameters”string
buffer
Section titled “buffer”Uint8Array
The buffer to write. You must set the byteOffset and byteLength appropriately!
offset
Section titled “offset”number
The offset in the file to start writing
Returns
Section titled “Returns”Promise<void>
Overrides
Section titled “Overrides”Async(FileSystem).write
writeSync()
Section titled “writeSync()”
abstractwriteSync(path,buffer,offset):void
Defined in: src/internal/filesystem.ts:311
Writes a buffer to a file
Parameters
Section titled “Parameters”string
buffer
Section titled “buffer”Uint8Array
The buffer to write. You must set the byteOffset and byteLength appropriately!
offset
Section titled “offset”number
The offset in the file to start writing
Returns
Section titled “Returns”void