io/File

class File
extends:Object
static method new(path: String)File
static method new~parentFile(parent: File, path: String)File
static method new~parentPath(parent, path: String)File
method isDirBool
Returns:true if it’s a directory
method isFileBool
Returns:true if it’s a file (ie. not a directory nor a symbolic link)
Returns:true if the file is a symbolic link
method sizeLLong
Returns:the size of the file, in bytes
method existsBool
Returns:true if the file exists and can be

opened for reading

method ownerPermInt
Returns:the permissions for the owner of this file
method groupPermInt
Returns:the permissions for the group of this file
method otherPermInt
Returns:the permissions for the others (not owner, not group)
method nameString
Returns:the last part of the path, e.g. for /etc/init.d/bluetooth

name() will return ‘bluetooth’

method parentFile
Returns:the parent of this file, e.g. for /etc/init.d/bluetooth

it will return /etc/init.d/ (as a File), or null if it’s the root directory.

method parentNameString
Returns:the parent of this file, e.g. for /etc/init.d/bluetooth

it will return /etc/init.d/ (as a File), or null if it’s the root directory.

method mkdirInt
create a directory at the path specified by this file, with permissions 0c755 by default
method mkdir~withMode(mode: Int32)Int

create a directory at the path specified by this file

Parameter:mode – The permissions at the creation of the directory
method mkdirs
create a directory at the path specified by this file, and all the parent directories if needed, with permissions 0c755 by default
method mkdirs~withMode(mode: Int32)Int

create a directory at the path specified by this file, and all the parent directories if needed

Parameter:mode – The permissions at the creation of the directory
method lastAccessedLong
Returns:the time of last access
method lastModifiedLong
Returns:the time of last modification
method createdLong
Returns:the time of creation
method isRelativeBool
Returns:true if the function is relative to the current directory
method getPathString
the path this file has been created with
method getAbsolutePathString
The absolute path, e.g. “my/dir” => “/current/directory/my/dir”
method getAbsoluteFileFile

A file corresponding to the absolute path

See:getAbsolutePath
method getChildrenNamesArrayList<T>
List the name of the children of this path Works only on directories, obviously
method getChildrenArrayList<T>
List the children of this path Works only on directories, obviously
method removeInt
Tries to remove the file. This only works for files, not directories.
method copyTo(dstFile: File)

Copies the content of this file to another

Parameter:dstFile – the file to copy to
method readString
method write~string(str: String)
method write~reader(reader: Reader)
method getChild(name: String)File

Get a child of this path

Parameter:name – The name of the child, relatively to this path
static method getCwdString
Returns:the current working directory
MAX_PATH_LENGTHInt
pathString
separatorChar
pathDelimiterChar

This Page