wechat/filesystem
filesystem module provides file system API bindings details in wechat document
Values
pub fn access(
fsm: object.JsObject,
path p: String,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
FileSystemManager.access
Check if a file exists
pub fn access_sync(fsm: object.JsObject, path p: String) -> Nil
FileSystemManager.accessSync
Synchronously check if a file exists
pub fn append_file(
fsm: object.JsObject,
path p: String,
data d: object.JsObject,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
FileSystemManager.appendFile
Append content to a file
pub fn append_file_sync(
fsm: object.JsObject,
path p: String,
data d: object.JsObject,
) -> Nil
FileSystemManager.appendFileSync
Synchronously append content to a file
pub fn close(
fsm: object.JsObject,
fd: Float,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
FileSystemManager.close
Close a file
pub fn close_sync(fsm: object.JsObject, fd: Float) -> Nil
FileSystemManager.closeSync
Synchronously close a file
pub fn copy_file(
fsm: object.JsObject,
src s: String,
dest d: String,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
FileSystemManager.copyFile
Copy a file
pub fn copy_file_sync(
fsm: object.JsObject,
src s: String,
dest d: String,
) -> Nil
FileSystemManager.copyFileSync
Synchronously copy a file
pub fn fstat(
fsm: object.JsObject,
fd: Float,
options o: object.JsObject,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
FileSystemManager.fstat
Get file statistics by file descriptor
pub fn fstat_sync(
fsm: object.JsObject,
fd: Float,
options o: object.JsObject,
) -> object.JsObject
FileSystemManager.fstatSync
Synchronously get file statistics by file descriptor
pub fn ftruncate(
fsm: object.JsObject,
fd: Float,
len: Int,
options o: object.JsObject,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
FileSystemManager.ftruncate
Truncate a file by file descriptor
pub fn ftruncate_sync(
fsm: object.JsObject,
fd: Float,
len: Int,
options o: object.JsObject,
) -> Nil
FileSystemManager.ftruncateSync
Synchronously truncate a file by file descriptor
pub fn get_file_info(
fsm: object.JsObject,
path p: String,
options o: object.JsObject,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
FileSystemManager.getFileInfo
Get file information
pub fn get_file_system_manager() -> object.JsObject
wx.getFileSystemManager
Get the file system manager object
pub fn get_saved_file_list(
fsm: object.JsObject,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
FileSystemManager.getSavedFileList
Get list of saved files
pub fn mkdir(
fsm: object.JsObject,
dir d: String,
options o: object.JsObject,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
FileSystemManager.mkdir
Create a directory
pub fn mkdir_sync(
fsm: object.JsObject,
dir d: String,
options o: object.JsObject,
) -> Nil
FileSystemManager.mkdirSync
Synchronously create a directory
pub fn open(
fsm: object.JsObject,
path p: String,
options o: object.JsObject,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
FileSystemManager.open
Open a file
pub fn open_sync(
fsm: object.JsObject,
path p: String,
options o: object.JsObject,
) -> Float
FileSystemManager.openSync
Synchronously open a file
pub fn read(
fsm: object.JsObject,
fd: Float,
options o: object.JsObject,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
FileSystemManager.read
Read from a file
pub fn read_compressed_file(
fsm: object.JsObject,
path p: String,
options o: object.JsObject,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
FileSystemManager.readCompressedFile
Read a compressed file
pub fn read_compressed_file_sync(
fsm: object.JsObject,
path p: String,
options o: object.JsObject,
) -> object.JsObject
FileSystemManager.readCompressedFileSync
Synchronously read a compressed file
pub fn read_file(
fsm: object.JsObject,
path p: String,
encoding e: String,
position pos: Int,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
FileSystemManager.readFile
Read a file
pub fn read_file_sync(
fsm: object.JsObject,
path p: String,
encoding e: String,
position pos: Int,
) -> object.JsObject
FileSystemManager.readFileSync
Synchronously read a file
pub fn read_sync(
fsm: object.JsObject,
fd: Float,
options o: object.JsObject,
) -> object.JsObject
FileSystemManager.readSync
Synchronously read from a file
pub fn readdir(
fsm: object.JsObject,
dir d: String,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
FileSystemManager.readdir
Read directory contents
pub fn readdir_sync(
fsm: object.JsObject,
dir d: String,
) -> object.JsObject
FileSystemManager.readdirSync
Synchronously read directory contents
pub fn remove_saved_file(
fsm: object.JsObject,
file f: String,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
FileSystemManager.removeSavedFile
Remove a saved file
pub fn rename(
fsm: object.JsObject,
old_path o: String,
new_path n: String,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
FileSystemManager.rename
Rename a file or directory
pub fn rename_sync(
fsm: object.JsObject,
old_path o: String,
new_path n: String,
) -> Nil
FileSystemManager.renameSync
Synchronously rename a file or directory
pub fn rmdir(
fsm: object.JsObject,
dir d: String,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
FileSystemManager.rmdir
Remove a directory
pub fn rmdir_sync(fsm: object.JsObject, dir d: String) -> Nil
FileSystemManager.rmdirSync
Synchronously remove a directory
pub fn save_file(
fsm: object.JsObject,
temp_file_path t: String,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
FileSystemManager.saveFile
Save a file
pub fn save_file_sync(
fsm: object.JsObject,
temp_file_path t: String,
) -> String
FileSystemManager.saveFileSync
Synchronously save a file
pub fn stat(
fsm: object.JsObject,
path p: String,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
FileSystemManager.stat
Get file statistics
pub fn stat_sync(
fsm: object.JsObject,
path p: String,
) -> object.JsObject
FileSystemManager.statSync
Synchronously get file statistics
pub fn unlink(
fsm: object.JsObject,
file f: String,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
FileSystemManager.unlink
Delete a file
pub fn unlink_sync(fsm: object.JsObject, file f: String) -> Nil
FileSystemManager.unlinkSync
Synchronously delete a file
pub fn unzip(
fsm: object.JsObject,
zip_path z: String,
target_path t: String,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
FileSystemManager.unzip
Unzip a file
pub fn write(
fsm: object.JsObject,
fd: Float,
data d: object.JsObject,
options o: object.JsObject,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
FileSystemManager.write
Write to a file
pub fn write_file(
fsm: object.JsObject,
path p: String,
data d: object.JsObject,
encoding e: String,
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
FileSystemManager.writeFile
Write to a file
pub fn write_file_sync(
fsm: object.JsObject,
path p: String,
data d: object.JsObject,
encoding e: String,
) -> Nil
FileSystemManager.writeFileSync
Synchronously write to a file
pub fn write_sync(
fsm: object.JsObject,
fd: Float,
data d: object.JsObject,
options o: object.JsObject,
) -> Int
FileSystemManager.writeSync
Synchronously write to a file