Class File
Object
|
+--File
- class
File
Class implementing basic support for files
Defined in file.js
Field Summary |
Object |
name
|
Constructor Summary |
File(<String> name)
Create a reference to a file system object (file or directory)
|
Method Summary |
void
|
close()
Close streams associated with file
|
String
|
getAbsolutePath(<Number> mode)
Return absolute path
|
File
|
getParentFile()
Return the parent file of this file object
|
String[]
|
list()
Return list of files contained in the directory referenced by the File object
|
ByteString
|
readAllAsBinary()
Read complete file into ByteString object
|
String
|
readAllAsString(encoding)
Read complete file into String object
|
void
|
writeAll(<Object> obj, encoding)
Write the object to file
|
<static> void
|
test()
|
name
Object name
File
File(<String> name)
Create a reference to a file system object (file or directory)
Parameters:
name
- relative or absolute file path
close
void close()
Close streams associated with file
getAbsolutePath
String getAbsolutePath(<Number> mode)
Parameters:
mode
- one of GPSystem.AUTO, GPSystem.CWD, GPSystem.USR or GPSystem.SYS. See GPSystem.mapFilename() for details
getParentFile
File getParentFile()
Return the parent file of this file object
Returns:
the parent file object or null
list
String[] list()
Return list of files contained in the directory referenced by the File object
readAllAsBinary
ByteString readAllAsBinary()
Read complete file into ByteString object
readAllAsString
String readAllAsString(encoding)
Read complete file into String object
writeAll
void writeAll(<Object> obj, encoding)
Parameters:
obj
- to write to file (Using toString() for any other than String and ByteString)
one
- of UTF8 or ASCII (Default is UTF8)
test
<static> void test()
Documentation generated by
JSDoc on Tue Apr 15 22:10:49 2025