devFS
devFS():
Fileserver
Defined in: packages/core/src/kernel/fileservers/dev.ts:128
Create a /dev fileserver with stream-backed null / zero / random / time nodes.
Returns
Section titled “Returns”A read-mostly Fileserver hosting the four device nodes.
Remarks
Section titled “Remarks”Mount at /dev to expose the four canonical pseudo-devices:
/dev/null— reads return 0 bytes (EOF); writes are discarded./dev/zero— reads return a buffer ofcountzero bytes; writes discarded./dev/random— reads are filled bycrypto.getRandomValues./dev/time— reads return${Date.now()}\nonce (then EOF); writes EPERM.
All other paths throw ENOENT. mkdir / remove / rename / wstat
unconditionally throw EPERM. The namespace directly inserts this mount
during boot (Unix + stdSystem) — you rarely need to call
it yourself unless assembling a custom root.
Example
Section titled “Example”import { devFS } from '@fishnet/core'const dev = devFS()const fd = await dev.open('/random', { read: true })const bytes = await dev.read(fd, 0, 16) // 16 random bytesawait dev.close(fd)Caveat
Section titled “Caveat”/dev/time snapshots Date.now() at open() — each fresh open
observes a fresh timestamp, but a second read on the same fd
returns EOF (it is not a ticking clock).