Documentation generator: JsDoc Toolkit 2.4.0
Template: Codeview 1.2
Generated on: 2011-4-25 9:22

Class WebFS

WebFS object

Class Summary
Constructor Attributes Constructor Name and Description
 
WebFS()
Can take a pre-existing native local filesystem as a parameter.

Method Summary

Method Attributes Method Name and Description
 
chmod(path, mode, callback)
Stub chmod function for nodejs compatiblity
 
close(fd, callback)
'Close' a file or directory handler by setting it to null
 
createBlob(data, encoding)
Takes data, string or binary, and creates a binary blob.
 
errorHandler(error)
Error handler for file system operations
 
fstat(fd, callback)
Returns a stat object from a file descriptor
 
Get the current raw filesystem for this WebFS object
 
Returns if requestFileSystem is available
 
link(srcpath, destpath, callback)
Stub link function for nodejs compatibility
 
lstat(path, callback)
Returns a stat object from a path
 
mkdir(path, mode, callback)
Creates a directory on the filesystem, will recursivly create paths
 
open(path, flags, mode, callback)
Opens a file or directory and return a handler
 
read(fileHandler, buffer, offset, length, position, callback)
Read data from the file specified by file handler.
 
readArrayBuffer(data, callback)
Method to get content as a array buffer
 
readBinaryString(data, callback)
Method to get content as a binary string
 
readDataUrl(data, callback)
Method to get content as a data url
 
readdir(path, callback)
Reads the contents of a directory, returns the result as an array of entries
 
readFile(filename, encoding, callback)
Asynchronously reads the entire contents of a file and returns a buffer
 
readlink(path, callback)
Stub readlink function for nodejs compatibility
 
readString(data, encoding, callback)
Method to get content of a blob or file as a string
 
realpath(path, callback)
Stub realpath function for nodejs compatibility
 
rename(src, dest, callback)
Rename or move src to dest.
 
rmdir(path, callback)
Deletes a directory from the path.
 
setFileSystem(type, size, callback)
If the user does not use an external fs object, we can call this method to create a new file system object
 
stat(path, callback)
Returns a stat object from a path
 
symlink(linkdata, path, callback)
Stub symlink function for nodejs compatibility
 
truncate(fileEntry, len, callback)
Takes a file handler and truncates the content to the passed length
 
unlink(path, callback)
Deletes a file from the path.
 
write(fileHandler, buffer, offset, length, position, callback)
Writes the contents of a Blob or File to a FileEntry on the filesystem
 
writeFile(filename, data, encoding, callback)
Asynchronously writes data to a file, replacing the file if it already exists.

Class Detail

WebFS()
Can take a pre-existing native local filesystem as a parameter. If not parameter passed, filesystem can be set with setFileSystem

Method Detail

  • chmod(path, mode, callback)
    Stub chmod function for nodejs compatiblity
    Parameters:
    {String} path
    {Number} mode
    {Function} callback
  • close(fd, callback)
    'Close' a file or directory handler by setting it to null
    Parameters:
    {FileEntry|DirectoryEntry} fd
    {Function} callback
  • createBlob(data, encoding)
    Takes data, string or binary, and creates a binary blob.
    Parameters:
    {Mixed} data
    {String} encoding
  • errorHandler(error)
    Error handler for file system operations
    Parameters:
    {Error} error
  • fstat(fd, callback)
    Returns a stat object from a file descriptor
    Parameters:
    {FileEntry|DirectoryEntry} fd
    {Function} callback
  • getFileSystem()
    Get the current raw filesystem for this WebFS object
  • isAvailable()
    Returns if requestFileSystem is available
  • Stub link function for nodejs compatibility
    Parameters:
    {String} srcpath
    {String} destpath
    {Function} callback
  • lstat(path, callback)
    Returns a stat object from a path
    Parameters:
    {String} path
    {Function} callback
  • mkdir(path, mode, callback)
    Creates a directory on the filesystem, will recursivly create paths
    Parameters:
    {String} path
    {Number} mode
    {Function} callback
  • open(path, flags, mode, callback)
    Opens a file or directory and return a handler
    Parameters:
    {String} path
    {String} flags
    {Number} mode
    {Function} callback
  • read(fileHandler, buffer, offset, length, position, callback)
    Read data from the file specified by file handler.
    Parameters:
    {FileEntry} fileHandler
    {Mixed} buffer
    {Number} offset
    {Number} length
    {Number} position
    callback
  • readArrayBuffer(data, callback)
    Method to get content as a array buffer
    Parameters:
    {File|Blob} data
    {Function} callback
  • readBinaryString(data, callback)
    Method to get content as a binary string
    Parameters:
    {File|Blob} data
    {Function} callback
  • readDataUrl(data, callback)
    Method to get content as a data url
    Parameters:
    {File|Blob} data
    {Function} callback
  • readdir(path, callback)
    Reads the contents of a directory, returns the result as an array of entries
    Parameters:
    {String} path
    {Function} callback
  • readFile(filename, encoding, callback)
    Asynchronously reads the entire contents of a file and returns a buffer
    Parameters:
    {String} filename
    {String} encoding
    {Function} callback
  • Stub readlink function for nodejs compatibility
    Parameters:
    {String} path
    {Function} callback
  • readString(data, encoding, callback)
    Method to get content of a blob or file as a string
    Parameters:
    {File|Blob} data
    {String} encoding
    {Function} callback
  • realpath(path, callback)
    Stub realpath function for nodejs compatibility
    Parameters:
    {String} path
    {Function} callback
  • rename(src, dest, callback)
    Rename or move src to dest. If dest is a directory, must contain a trailing '/' char.
    Parameters:
    {String} src
    {String} dest
    {Function} callback
  • rmdir(path, callback)
    Deletes a directory from the path. Directories are removed recursivly
    Parameters:
    {String} path
    {Function} callback
  • setFileSystem(type, size, callback)
    If the user does not use an external fs object, we can call this method to create a new file system object
    Parameters:
    {Number} type
    {Number} size
    {Function} callback
  • stat(path, callback)
    Returns a stat object from a path
    Parameters:
    {String} path
    {Function} callback
  • Stub symlink function for nodejs compatibility
    Parameters:
    {String} linkdata
    {String} path
    {Function} callback
  • truncate(fileEntry, len, callback)
    Takes a file handler and truncates the content to the passed length
    Parameters:
    {FileEntry} fileEntry
    {Number} len
    {Function} callback
  • Deletes a file from the path. Directories are removed recursivly
    Parameters:
    {String} path
    {Function} callback
  • write(fileHandler, buffer, offset, length, position, callback)
    Writes the contents of a Blob or File to a FileEntry on the filesystem
    Parameters:
    {FileEntry} fileHandler
    {Mixed} buffer
    {Number} offset
    {Number} length
    {Number} position
    {Function} callback
  • writeFile(filename, data, encoding, callback)
    Asynchronously writes data to a file, replacing the file if it already exists. Data can be a string or a buffer.
    Parameters:
    {String} filename
    {Mixed} data
    {String} encoding
    {Function} callback