Object | +--File
Deprecated use {link helma.File} instead
Defined in File.js
| SUMMARY: Constructor | Properties | Methods | DETAIL: Constructor | Properties | Methods |
| Constructor Summary | |
File(<String> filepath)
Constructor for File objects, providing read and write access to the file system. |
|
| Methods Summary | |
Boolean
|
canRead()
Tests whether the application can read the file represented by this File object. |
Boolean
|
canWrite()
Tests whether the file represented by this File object is writable. |
void
|
clearError()
Clears any error message that may otherwise be returned by the error method. |
Boolean
|
close()
Closes the file represented by this File object. |
Boolean
|
eof()
Returns true if the file represented by this File object has been read entirely and the end of file has been reached. |
String
|
error(Object)
Contains the last error that occured, if any. |
Boolean
|
exists()
Tests whether the file or directory represented by this File object exists. |
Boolean
|
flush()
Purges the content of the file represented by this File object. |
String
|
getAbsolutePath()
Returns the absolute pathname string of this file. |
Number
|
getLength()
Returns the length of the file represented by this File object. |
String
|
getName()
Returns the name of the file or directory represented by this File object. |
String
|
getParent()
Returns the pathname string of this File object's parent directory. |
String
|
getPath()
Returns the pathname string of this File object. |
Boolean
|
isAbsolute()
Tests whether this File object's pathname is absolute. |
Boolean
|
isDirectory()
Tests whether the file represented by this File object is a directory. |
Boolean
|
isFile()
Tests whether the file represented by this File object is a normal file. |
Boolean
|
isOpened()
Returns true if the file represented by this File object is currently open. |
Number
|
lastModified()
Returns the time when the file represented by this File object was last modified. |
Object
|
list(<RegExp> pattern)
List of all files within the directory represented by this File object. |
Boolean
|
mkdir()
Creates the directory represented by this File object. |
Boolean
|
open()
Opens the file represented by this File object. |
String
|
readAll()
This methods reads all the lines contained in the file and returns them. |
String
|
readln()
This methods reads characters until an end of line/file is encountered then returns the string for these characters (without any end of line character). |
Boolean
|
remove()
Deletes the file or directory represented by this File object. |
Boolean
|
renameTo(<String> dest)
Renames the file represented by this File object. |
Boolean
|
write(<String> data)
Appends a string to the file represented by this File object. |
Boolean
|
writeln(<String> data)
Appends a string with a platform specific end of line to the file represented by this File object. |
| Constructor Detail |
File(<String> filepath)
var fileOrDir = new File('static/test.txt');
filepath - as String
| Method Detail |
Boolean canRead()
Boolean canWrite()
void clearError()
Boolean close()
Boolean eof()
String error(Object)
Boolean exists()
Boolean flush()
String getAbsolutePath()
Number getLength()
String getName()
String getParent()
String getPath()
Boolean isAbsolute()
Boolean isDirectory()
Boolean isFile()
Boolean isOpened()
Number lastModified()
Object list(<RegExp> pattern)
var xmlFiles = dir.list(/.*\.xml/);
pattern - as RegExp, optional pattern to test each file name against
Boolean mkdir()
Boolean open()
String readAll()
String readln()
Boolean remove()
Boolean renameTo(<String> dest)
dest - as String, new pathname for the named file
Boolean write(<String> data)
data - as String, to be written to the file
Boolean writeln(<String> data)
data - as String, to be written to the file
| SUMMARY: Constructor | Properties | Methods | DETAIL: Constructor | Properties | Methods |