File and simple URI streams

Open read stream from a file or URI

let input = await io.openRead(uri); 
  • uri could be eithera local FS file name, like ~/docs/daily_notes.md, or any URI the system is capable to connect to.

returns u8 InputStream to read from this source.

Open write stream to a file or URI

let output = openWrite(url, mode = "w", 
                       {bufferLength = chunkSize, umask = 0o644}={});
  • uri could be either a local FS file name, like ~/docs/daily_notes.md, or any URI system is capable to connect to.
  • mode: one of "w" for write, "a" for append.
  • umask: a regular Unix access mask, default is 0o644 whan means -rw-r--r-- in unix terms.

returns u8 OutputStream to write to this target.

Supported URI protocols

protocol direction description
file:/ file:/// rw local filesystem access limited only by the process owner rights

Under construction:

  • process pipes, network sockets, http downloads.