Sequence Write



↳ const append: bool = false
↳ const create: bool = true
↳ const new: bool = false


path: Block<string>
data: Stream<byte>


↦ amount: Stream<u64>
↦ success: Block<void>
↦ failure: Block<void>
↦ message: Stream<string>

Write one file.

The bytes received through data are written in the file located at path. The writing behavior is set up by the parameters:

  • append: bytes are added to the file instead of replacing the existing file;
  • create: if the file does not exists, it is created;
  • new: the file is required to being new, if a file already exists at that path then the writing fails.

The amount of written bytes is sent through amount. There is no guarantee about its increment, as an undefined number of bytes may be written at once.

success is emitted when successful writting is finished. failure is emitted if an error occurs, and message contains the related text.