Options
All
  • Public
  • Public/Protected
  • All
Menu

A read-write filesystem backed by the HTML5 FileSystem API.

As the HTML5 FileSystem is only implemented in Blink, this interface is only available in Chrome.

Hierarchy

Implements

Index

Constructors

constructor

  • new HTML5FS(size?: number, type?: number, deprecateMsg?: boolean): HTML5FS
  • Deprecated. Please use HTML5FS.Create() method instead.

    Creates a new HTML5 FileSystem-backed BrowserFS file system of the given size and storage type.

    IMPORTANT: You must call allocate on the resulting object before the file system can be used.

    Parameters

    • Default value size: number = 5

      storage quota to request, in megabytes. Allocated value may be less.

    • Default value type: number = global.PERSISTENT

      window.PERSISTENT or window.TEMPORARY. Defaults to PERSISTENT.

    • Default value deprecateMsg: boolean = true

    Returns HTML5FS

Properties

fs

fs: FileSystem

Methods

allocate

  • Deprecated. Please use Create() method instead to create and allocate an HTML5FS.

    Requests a storage quota from the browser to back this FS. Must be called before file system can be used!

    Parameters

    • Default value cb: BFSOneArgCallback = () => {/*nop*/}
    • Default value deprecateMsg: boolean = true

    Returns void

appendFile

appendFileSync

  • appendFileSync(fname: string, data: any, encoding: string | null, flag: FileFlag, mode: number): void

chmod

chmodSync

  • chmodSync(p: string, isLchmod: boolean, mode: number): void

chown

  • chown(p: string, isLchown: boolean, uid: number, gid: number, cb: BFSOneArgCallback): void

chownSync

  • chownSync(p: string, isLchown: boolean, uid: number, gid: number): void

createFile

createFileSync

  • createFileSync(p: string, flag: FileFlag, mode: number): File

diskSpace

  • diskSpace(p: string, cb: function): void

empty

  • Deletes everything in the FS. Used for testing. Karma clears the storage after you quit it but not between runs of the test suite, and the tests expect an empty FS every time.

    Parameters

    Returns void

exists

  • exists(p: string, cb: function): void

existsSync

  • existsSync(p: string): boolean

getName

  • getName(): string

isReadOnly

  • isReadOnly(): boolean

link

linkSync

  • linkSync(srcpath: string, dstpath: string): void

mkdir

mkdirSync

  • mkdirSync(p: string, mode: number): void

open

openFile

openFileSync

  • openFileSync(p: string, flag: FileFlag, mode: number): File
  • Opens the file at path p with the given flag. The file must exist.

    Parameters

    • p: string

      The path to open.

    • flag: FileFlag

      The flag to use when opening the file.

    • mode: number

    Returns File

    A File object corresponding to the opened file.

openSync

readFile

  • readFile(fname: string, encoding: string | null, flag: FileFlag, cb: BFSCallback<string | Buffer>): void

readFileSync

  • readFileSync(fname: string, encoding: string | null, flag: FileFlag): any

readdir

  • readdir(path: string, cb: BFSCallback<string[]>): void

readdirSync

  • readdirSync(p: string): string[]

readlink

readlinkSync

  • readlinkSync(p: string): string

realpath

  • realpath(p: string, cache: object, cb: BFSCallback<string>): void

realpathSync

  • realpathSync(p: string, cache: object): string

rename

renameSync

  • renameSync(oldPath: string, newPath: string): void

rmdir

rmdirSync

  • rmdirSync(p: string): void

stat

statSync

  • statSync(p: string, isLstat: boolean | null): Stats

supportsLinks

  • supportsLinks(): boolean

supportsProps

  • supportsProps(): boolean

supportsSymlinks

  • supportsSymlinks(): boolean

supportsSynch

  • supportsSynch(): boolean

symlink

  • symlink(srcpath: string, dstpath: string, type: string, cb: BFSOneArgCallback): void

symlinkSync

  • symlinkSync(srcpath: string, dstpath: string, type: string): void

truncate

truncateSync

  • truncateSync(p: string, len: number): void

unlink

unlinkSync

  • unlinkSync(p: string): void

utimes

utimesSync

  • utimesSync(p: string, atime: Date, mtime: Date): void

writeFile

writeFileSync

  • writeFileSync(fname: string, data: any, encoding: string | null, flag: FileFlag, mode: number): void

Static Create

Static isAvailable

  • isAvailable(): boolean

Generated using TypeDoc