RepackedSyncClient
Defined in: packages/pgwasm/src/opfs/broker/client.ts:167
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new RepackedSyncClient(
channel,options?):RepackedSyncClient
Defined in: packages/pgwasm/src/opfs/broker/client.ts:173
Parameters
Section titled “Parameters”channel
Section titled “channel”options?
Section titled “options?”RepackedSyncClientOptions = {}
Returns
Section titled “Returns”RepackedSyncClient
Properties
Section titled “Properties”channel
Section titled “channel”
readonlychannel:RepackedChannel
Defined in: packages/pgwasm/src/opfs/broker/client.ts:168
Accessors
Section titled “Accessors”maxTransferBytes
Section titled “maxTransferBytes”Get Signature
Section titled “Get Signature”get maxTransferBytes():
number
Defined in: packages/pgwasm/src/opfs/broker/client.ts:182
The largest single read or write that fits one request. Reads/writes above it are chunked.
Returns
Section titled “Returns”number
Methods
Section titled “Methods”close()
Section titled “close()”close(
fd):BrokerResult
Defined in: packages/pgwasm/src/opfs/broker/client.ts:195
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”fstat()
Section titled “fstat()”fstat(
fd):BrokerStatResult
Defined in: packages/pgwasm/src/opfs/broker/client.ts:275
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”fsync()
Section titled “fsync()”fsync(
fd?):BrokerResult
Defined in: packages/pgwasm/src/opfs/broker/client.ts:266
Flush the store. Durability is STORE-WIDE, not per-descriptor: on success every byte written
through this broker by any client before the call returned is recoverable. fd is validated so
the call still rejects a descriptor this client does not own.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”lstat()
Section titled “lstat()”lstat(
path):BrokerStatResult
Defined in: packages/pgwasm/src/opfs/broker/client.ts:284
Reports the LINK itself when the final component is one; stat follows it instead.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”mkdir()
Section titled “mkdir()”mkdir(
path,options?):BrokerResult
Defined in: packages/pgwasm/src/opfs/broker/client.ts:340
Parameters
Section titled “Parameters”string
options?
Section titled “options?”number
recursive?
Section titled “recursive?”boolean
Returns
Section titled “Returns”open()
Section titled “open()”open(
path,flags,mode?):BrokerOpenResult
Defined in: packages/pgwasm/src/opfs/broker/client.ts:186
Parameters
Section titled “Parameters”string
number
number = 0o100666
Returns
Section titled “Returns”read()
Section titled “read()”read(
fd,length,position?):BrokerReadResult
Defined in: packages/pgwasm/src/opfs/broker/client.ts:204
Read up to length bytes. With no position the store’s own descriptor cursor is used and
advances; with a position the cursor is untouched (fd_pread). A result shorter than length
means end-of-file, never a partial transport.
Parameters
Section titled “Parameters”number
length
Section titled “length”number
position?
Section titled “position?”bigint
Returns
Section titled “Returns”readdir()
Section titled “readdir()”readdir(
path):BrokerReaddirResult
Defined in: packages/pgwasm/src/opfs/broker/client.ts:309
The complete listing, paged transparently over as many requests as the channel needs.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”readdirPage()
Section titled “readdirPage()”readdirPage(
path,cursor?):BrokerReaddirPageResult
Defined in: packages/pgwasm/src/opfs/broker/client.ts:326
One page of a listing, for a caller that owns its own cookie (WASI fd_readdir). The cursor is an
index into the store’s sorted listing, recomputed per call — a paged listing is therefore not an
atomic snapshot, which is exactly what POSIX readdir allows.
Parameters
Section titled “Parameters”string
cursor?
Section titled “cursor?”number = 0
Returns
Section titled “Returns”readlink()
Section titled “readlink()”readlink(
path):BrokerReadlinkResult
Defined in: packages/pgwasm/src/opfs/broker/client.ts:302
The target of the symbolic link at path. EINVAL when the path is not a link.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”rename()
Section titled “rename()”rename(
oldPath,newPath):BrokerResult
Defined in: packages/pgwasm/src/opfs/broker/client.ts:358
Parameters
Section titled “Parameters”oldPath
Section titled “oldPath”string
newPath
Section titled “newPath”string
Returns
Section titled “Returns”rmdir()
Section titled “rmdir()”rmdir(
path):BrokerResult
Defined in: packages/pgwasm/src/opfs/broker/client.ts:350
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”size()
Section titled “size()”size(
path):BrokerSizeResult
Defined in: packages/pgwasm/src/opfs/broker/client.ts:383
The size of one file, without the rest of a stat. EISDIR for a directory.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”stat()
Section titled “stat()”stat(
path):BrokerStatResult
Defined in: packages/pgwasm/src/opfs/broker/client.ts:279
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”symlink()
Section titled “symlink()”symlink(
target,path):BrokerResult
Defined in: packages/pgwasm/src/opfs/broker/client.ts:292
Create a symbolic link at path pointing at target. Targets are ABSOLUTE — the store refuses
a relative one with EINVAL rather than reinterpreting it against the link’s directory.
Parameters
Section titled “Parameters”target
Section titled “target”string
string
Returns
Section titled “Returns”truncate()
Section titled “truncate()”truncate(
path,size):BrokerResult
Defined in: packages/pgwasm/src/opfs/broker/client.ts:373
Resize by PATH. The core store has no resize-by-descriptor, so a WASI fd_filestat_set_size
adapter keeps the path each fd was opened with and calls this. Nothing is lost by that: the store
has no hard links, and a descriptor whose path was unlinked meanwhile is an orphan the core keeps
readable but no longer resizes.
Parameters
Section titled “Parameters”string
bigint
Returns
Section titled “Returns”unlink()
Section titled “unlink()”unlink(
path):BrokerResult
Defined in: packages/pgwasm/src/opfs/broker/client.ts:354
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”write()
Section titled “write()”write(
fd,bytes,position?):BrokerCountResult
Defined in: packages/pgwasm/src/opfs/broker/client.ts:237
Write bytes. With no position the store’s own descriptor cursor is used and advances; with a
position the cursor is untouched (fd_pwrite). A descriptor opened with O_APPEND always
writes at end-of-file and ignores position, exactly as POSIX requires.
Parameters
Section titled “Parameters”number
Uint8Array
position?
Section titled “position?”bigint