File object

Property Description Access Type
File.name Get the File name (with its extension) readonly string
File.size Get the File size on disk readonly number
File.extension Get only the File extension readonly string
File.fullpath Get full path of the file readonly string
File.directory Get the directory that contains the file readonly Directory
File.path Get the file path readonly string
File.exists Check if the file exists readonly boolean
File.position Get/set the current file position readwrite number
File.eof Check if end of file (EOF) position has been reached readonly boolean
File.encoding Get the file encoding readonly string
File.lines Iterator over each line of the file readonly function
File.readonly Check if the file is readonly readwrite boolean
File.hidden Check if the file is hidden readwrite boolean
File.temporary Get/set the temporary status of the file readwrite boolean
File.created Get/set the file creation date and time readwrite Datetime
File.modified Get/set the last time the file have been modified readwrite Datetime
File.accessed Get/set last time the file was accessed readwrite Datetime
Method Description Return value
File.constructor() File object constructor File
File:open() Open the file for read/write/append operations. File
File:close() Close the file -
File:write() Write data to the file number
File:writeln() Write data and append a new line to the file* number
File:read() Read data from the file string or Buffer
File:readln() Read a line from the file string or Buffer
File:flush() Flush written data to the file -
File:remove() Delete the file boolean
File:copy() Create a new file with the same content File
File:move() Move the file to a new location/name boolean