binana.fs package

When used as a JavaScript library, BINANA cannot access the local file system to save and load files. These functions save and read files to a fake in-memory file system for use in the browser.

binana.fs.load_file(filename)[source]

Load a file from the fake (in-memory) file system. For transcrypt.

Parameters

filename (string) – The filename to load.

Returns

The contents of the file.

Return type

string

binana.fs.ls()[source]

List all files in the fake (in-memory) file system. For transcrypt.

binana.fs.save_file(filename, text)[source]

Save a file to the fake (in-memory) file system. This is for use with transcrypt.

Parameters
  • filename (string) – The filename.

  • text (string) – The contents of the file to save.