IO

rxsci.io.read(file, mode='r', size=None, encoding=None)

Reads the content of a file

Parameters
  • file – the path of the file to read, or a file object

  • mode – how the file must be opened. either ‘r’ to read text or ‘rb’ to read binary

  • size – [Optional] If set file if read by chunks of this size

  • encoding – [Optional] text encoding to use when reading in text mode

Returns

An observable where each item is a chunk of data, or the whole file if no size has been set.

rxsci.io.walk(top, recursive=True)

lists the content of a directory

Returns an observable emitting the files present in top directory and sub-directories.

The source must be an Observable.

Parameters

top – The directory to walk

Returns

An Observable emitting string path items

rxsci.io.write(file, mode=None, encoding=None)

Writes the content of a file

The source must be an Observable.

Parameters
  • file – the path of the file to read

  • mode – how the file must be opened. either ‘r’ to read text or ‘rb’ to read binary

  • size – [Optional] If set file if read by chunks of this size

  • encoding – [Optional] text encoding to use when reading in text mode

Returns

An observable where eeach item is a chunk of data, or the while file if no size has been set.