docs.rs failed to build rong_fs-0.3.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
rong_fs-0.1.1
rong_fs
File system operations for the Rong JavaScript runtime.
Core API
Two entry points cover all file read/write needs:
// Read — everything starts from Rong.file()
const f = ;
await f.; // string
await f.; // parsed JSON
await f.; // Uint8Array
await f.; // ArrayBuffer
f.; // ReadableStream
await f.; // boolean
await f.; // remove file
await f.; // FileInfo
await f.; // FileInfo (no follow symlink)
// Write — one function handles all data types
await ; // string
await ; // TypedArray
await ; // ArrayBuffer
await ;// copy (RongFile)
Low-level FileHandle
For random access, seek, and truncate — open a handle:
const handle = await .;
await handle.;
const buf = ;
await handle.;
await handle.;
await handle.; // must close
FileHandle methods: read(), write(), seek(), stat(), sync(), truncate(), close(), readable (getter), writable (getter).
Incremental Writing (FileSink)
For append or streaming writes:
// Append to log file
const w = await .;
await w.;
await w.;
await w.;
await w.;
// Overwrite (default, truncates existing)
const w2 = await .;
await w2.;
await w2.;
FileSink.write() accepts string | TypedArray | ArrayBuffer. Other methods: flush(), end().
Directory & Path Operations
Top-level functions under Rong:
mkdir(path, options?)— create directory, optionally{ recursive: true }readDir(path)— async iterator ofDirEntry(name,isFile,isDirectory,isSymlink)remove(path, options?)— remove file or directory, optionally{ recursive: true }rename(oldPath, newPath)— rename/moverealPath(path)— resolve to absolute canonical pathchdir(path)— change working directory
Symlink Operations
symlink(target, path)— create symbolic linkreadlink(path)— read symlink target
Permission & Timestamp Operations
chmod(path, mode)— change permissions (Unix only)chown(path, uid, gid)— change ownership (Unix only)utime(path, { accessed?, modified? })— set access/modification times
Constants
Rong.SeekMode.Start(0),Rong.SeekMode.Current(1),Rong.SeekMode.End(2)