|
Page Updated: December 29, 2005
Latest Version: 0.1.362 |
|
Debug |
Install | File
I/O |
RDF |
Network |
Sound | Utils |
XUL | Zip
|
|
|
Home | Mailing List |
Install |
Source Code |
Downloads | Bugs
| docs
| clients |
File API
Function List- Constructor
- File(aPath)
- creates the File object and sets the file path
- Accessors
- initWithPath(aPath);
- Initializes or reinitializes the File object
- open(aMode, aPermissions);
- open a file handle for reading, writing or appending. Permissions are optional. If aMode is omitted, then the file will be opened readonly.
- close();
- closes a file handle
- exists();
- check to see if a file exists
- EOF;
- checks for end of file
- read();
- returns the contents of a file
- readline();
- returns the next line in the file.
- readAllLines();
- returns string array of all lines in file
- write(aContents);
- Writes aContents out to the file.
- File attributes
- permissions;
- returns the files permissions
- dateModified;
- returns the last modified date object
- size;
- returns the file size
- isDir();
- bool returns true if the file is a directory
- isFile();
- bool returns true if the file is a file
- isExec();
- bool returns true if the file is executable
- isSymlink();
- bool returns true if the file is symbolic link
- isHidden();
- bool returns true if the file is hidden
- isSpecial();
- bool returns true if the file is special
- isWritable();
- bool returns true if the file is writable
- isReadable();
- bool returns true if the file is readable
- File string manipulation
- path;
- returns the path
- leaf;
- leaf is the endmost file string ex: foo.html in /myDir/foo.html
- ext;
- returns a file extension if there is one
- parent
- returns the a new File object of the files parent
- Direct manipulation
- nsIFIle;
- returns an nsIFile obj
- File utilities
- copy(aDest);
- copies current file to a destination
- clone();
- returns a clone of the jsLib File object
- append(aLeaf);
- appends a leaf on the the curent file object
- appendRelativePath(aRelPath);
- appends a relative path the the current file instance
- create();
- creates a new file
- move(aDest);
- moves a file to a new destination and file object is reinitialized to reflect this move
- remove();
- removes a file, the instance remains unchanged
- equals(aFileObj);
- bool to test if file objects are equal
- URL;
- read only getter that returns the local URL path eg: file:///foo/bar.dat
- Help!
- help;
- currently dumps a list of available functions