SystemFile new - Axiom

axiom.SystemFile is a library used for easy File access. To instantiate an axiom.SystemFile Object:

var file = new axiom.SystemFile(pathtofile);

Below are the methods available.

Contents

axiom.SystemFile.canRead()

Description

axiom.SystemFile.canRead()

Tests whether the application can read the file represented by this File object.

Returns

(Boolean) - True if the file can be read.


axiom.SystemFile.canWrite()

Description

axiom.SystemFile.canWrite()

Tests whether the file represented by this File object is writable.

Returns

(Boolean) - True if the file can be written to.


axiom.SystemFile.clearError()

Description

axiom.SystemFile.clearError()

Clears any error message that may otherwise be returned by the error method.


axiom.SystemFile.close()

Description

axiom.SystemFile.close()

Closes the file represented by this File object.


axiom.SystemFile.eof()

Description

axiom.SystemFile.eof()

Returns true if the file represented by this File object has been read entirely and the end of file has been reached.

Returns

(Boolean) - True if the file represented by this File object has been read entirely and the end of file has been reached.


axiom.SystemFile.error()

Description

axiom.SystemFile.error()

Contains the last error that occured, if any.

Returns

(String) - The last error that occured, if any.


axiom.SystemFile.exists()

Description

axiom.SystemFile.exists()

Tests whether the file or directory represented by this File object exists.

Returns

(Boolean) - True if the file or directory exists.


axiom.SystemFile.flush()

Description

axiom.SystemFile.flush()

Purges the content of the file represented by this File object.


axiom.SystemFile.getAbsolutePath()

Description

axiom.SystemFile.getAbsolutePath()

Returns the absolute pathname string of this file.

Returns

(String) - The absolute pathname string of this file.


axiom.SystemFile.getName()

Description

axiom.SystemFile.getName()

Returns the name of the file or directory represented by this File object.

Returns (String) - The name of the file or directory represented by this File object.


axiom.SystemFile.getLength()

Description

axiom.SystemFile.getLength()

Returns the length of the file represented by this File object.

Returns

(Number) - The length of the file represented by this File object. The return value is unspecified if this pathname denotes a directory.


axiom.SystemFile.getParent()

Description

axiom.SystemFile.getParent()

Returns the pathname string of this File object's parent directory.

Returns

(String) - The pathname of this File object's parent directory.


axiom.SystemFile.getPath()

Description

axiom.SystemFile.getPath()

Returns the pathname string of this File object. The resulting string uses the default name-separator character to separate the names in the name sequence.

Returns

(String) - The pathname string of this File object.


axiom.SystemFile.hardCopy()

Description

axiom.SystemFile.hardCopy(dest)

Makes a copy of a file over partitions.

Parameters

  • dest (SystemFile or String) - Destination as a SystemFile or String.


axiom.SystemFile.isAbsolute()

Description

axiom.SystemFile.isAbsolute()

Tests whether this File object's pathname is absolute.

Returns

(Boolean) - True if this File object's pathname is absolute.


axiom.SystemFile.isDirectory()

Description

axiom.SystemFile.isDirectory()

Tests whether the file represented by this File object is a directory.

Returns

(Boolean) - True if this File object is a directory.


axiom.SystemFile.isFile()

Description

axiom.SystemFile.isFile()

Tests whether the file represented by this File object is a normal file.

Returns

(Boolean) - True if this File object is a file.


axiom.SystemFile.isOpened()

Description

axiom.SystemFile.isOpened()

Returns true if the file represented by this File object is currently open.

Returns

(Boolean) - True if the File object is currently open.


axiom.SystemFile.lastModified()

Description

axiom.SystemFile.lastModified()

Returns the millisecond representation of the time when the file represented by this File object was last modified.

Returns

(Number) - The millisecond representation of the time when the file represented by this File object was last modified.


axiom.SystemFile.list()

Description

axiom.SystemFile.list(pattern)

List of all files within the directory represented by this File object.


Parameters

  • pattern (String) - A RegExp Pattern for files to match.

Returns

(Array) - List of the matching files.


axiom.SystemFile.listRecursive(pattern)

Description

axiom.SystemFile.listRecursive(pattern)

Recursivly lists all files below a given directory.

Parameters

  • pattern (String) - A RegExp Pattern for files to match.

Returns

(Array) - List of the matching files.


axiom.SystemFile.makeDirectory()

Description

axiom.SystemFile.makeDirectory()

Creates the directory represented by this File object.


axiom.SystemFile.move()

Description

axiom.SystemFile.move(dest)

Moves a file to a new destination directory.

Parameters

  • dest (String) - Full path to the new file.


axiom.SystemFile.open()

Description

axiom.SystemFile.open()

Opens the file represented by this File object


axiom.SystemFile.readAll()

Description

axiom.SystemFile.readAll()

This methods reads all the lines contained in the file and returns them.

Returns

(String) - All the lines contained in the file.


axiom.SystemFile.readln()

Description

axiom.SystemFile.readln()

Reads characters until an end of line/file is encountered then returns the string for these characters (without any end of line character).

Returns

(String) - The characters until an end of line/file is encountered.


axiom.SystemFile.remove()

Description

axiom.SystemFile.remove()

Deletes the file or directory represented by this File object.


axiom.SystemFile.removeDirectory()

Description

axiom.SystemFile.removeDirectory()

Removes the directory represented by this File object recursively.


axiom.SystemFile.renameTo()

Description

axiom.SystemFile.renameTo(toFile)

Renames the file represented by this File object.

Parameters

  • toFile (SystemFile) - The new File object to rename this one to.


axiom.SystemFile.toByteArray()

Description

axiom.SystemFile.toByteArray()

Returns file as ByteArray.

Returns

(ByteArray) - Byte Array representation of this File object.


axiom.SystemFile.write()

Description

axiom.SystemFile.write(data)

Appends a string to the file represented by this File object.

Parameters

  • data (String) - String to write.


axiom.SystemFile.writeln()

Description

axiom.SystemFile.writeln(data)

Appends a string with a platform specific end of line to the file represented by this File object.

Parameters

  • data (String) - String to write.