let read_all = |path: string| -> Result<string, `IOError(string)> 'sys_fs_read_all;
let read_all_bin = |path: string| -> Result<bytes, `IOError(string)> 'sys_fs_read_all_bin;
let write_all = |#path: string, data: string| -> Result<null, `IOError(string)> 'sys_fs_write_all;
let write_all_bin = |#path: string, data: bytes| -> Result<null, `IOError(string)> 'sys_fs_write_all_bin;
let is_file = |path: string| -> Result<string, `IOError(string)> 'sys_fs_is_file;
let is_dir = |path: string| -> Result<string, `IOError(string)> 'sys_fs_is_dir;
let metadata = |#follow_symlinks: bool = true, path: string| -> Result<Metadata, `IOError(string)> 'sys_fs_metadata;
let readdir = |
#max_depth: i64 = 1,
#min_depth: i64 = 1,
#contents_first: bool = false,
#follow_symlinks: bool = false,
#follow_root_symlink: bool = true,
#same_filesystem: bool = false,
path: string
| -> Result<Array<DirEntry>, `IOError(string)> 'sys_fs_readdir;
let create_dir = |#all: bool = false, path: string| -> Result<null, `IOError(string)> 'sys_fs_create_dir;
let remove_dir = |#all: bool = false, path: string| -> Result<null, `IOError(string)> 'sys_fs_remove_dir;
let remove_file = |path: string| -> Result<null, `IOError(string)> 'sys_fs_remove_file;
let open = |mode: Mode, path: string| -> Result<io::Stream<`File>, `IOError(string)> 'sys_fs_open;
let seek = |stream: io::Stream<`File>, pos: SeekFrom| -> Result<u64, `IOError(string)> 'sys_fs_seek;
let fstat = |stream: io::Stream<`File>| -> Result<Metadata, `IOError(string)> 'sys_fs_fstat;
let truncate = |stream: io::Stream<`File>, len: u64| -> Result<null, `IOError(string)> 'sys_fs_truncate