JS library_file - gd-99/symbiogd GitHub Wiki

A library to manage files.

Since 1.0alpha1.

Static methods

  • Webos.File.get(String|Webos.File file, Object [data], Boolean [disableCache]) : Get a file.
  • String|Webos.File file The path to the file.
  • Object [data] The file's data.
  • Boolean [disableCache] If set to true, the file will not be stored in the cache.
  • Webos.File.load(String|Webos.File path, Webos.Callback callback) : Load a file's metadata.
  • String|Webos.File path The path to the file.
  • Webos.Callback callback The callback.
  • Webos.File.listDir(String|Webos.File path, Webos.Callback callback) : List a directory's files.
  • String|Webos.File path The path to the directory.
  • Webos.Callback callback The callback.
  • Webos.File.createFile(String|Webos.File path, Webos.Callback callback) : Create an empty file.
  • String|Webos.File path The path to the new file.
  • Webos.Callback callback The callback.
  • Webos.File.createFolder(String|Webos.File path, Webos.Callback callback) : Create a new folder.
  • String|Webos.File path The path to the new folder.
  • Webos.Callback callback The callback.
  • Webos.File.copy(Webos.File|String source, Webos.File|String dest, Webos.Callback callback) : Copy a file.
  • Webos.File|String source The source file.
  • Webos.File|String dest The destination file.
  • Webos.Callback callback The callback.
  • Webos.File.move(Webos.File|String source, Webos.File|String dest, Webos.Callback callback) : Move a file.
  • Webos.File|String source The source file.
  • Webos.File|String dest The destination file.
  • Webos.Callback callback The callback.
  • Webos.File.SearchResultItem(object data, String|Webos.File file) : A search result item.
  • object data The result data.
  • String|Webos.File file The file.
  • Webos.Operation Webos.File.search(object options, Webos.Callback callback) : Search files.
  • object options Search's options.
  • Webos.Callback callback The callback.
  • Webos.File.isCached(String|Webos.File path) : Check if a file is in the cache.
  • String|Webos.File path The path to the file.
  • Webos.File.clearCache(String|Webos.File [path], Boolean [clearParentCache]) : Clear the cache.
  • String|Webos.File [path] If specified, only the corresponding file's cache will be cleared.
  • Boolean [clearParentCache] If set to true, the parent's cache will also be cleared.
  • Webos.File.cleanPath(String path) : Clean a path.
  • String path The path to clean.
  • Webos.File.bytesToSize(Number bytes) : Convert a size in bytes to a human-readable file size (e.g. 1024 -> 1 Kio).
  • Number bytes The size to convert.
  • Webos.File.mount(Webos.File.MountPoint point, Webos.Callback callback) : Mount a device.
  • Webos.File.MountPoint point The mount point.
  • Webos.Callback callback The callback.
  • Webos.File.mountedDevices() : Get a list of mounted devices.
  • Webos.File.getMountData(String local) : Get a specific mount point, giving its local path.
  • String local The mount point's local path.
  • Webos.File.umount(Webos.File.MountPoint point) : Umount a device.
  • Webos.File.MountPoint point The mount point.
  • Webos.File.registerDriver(String driverName, Object data) : Register a new file driver.
  • String driverName The driver's name.
  • Object data The driver's data.
  • Webos.File.getDriverData(String driverName) : Get a driver's data, giving its name.
  • String driverName The driver's name.