Filename API Functions
This document lists most useful (and most often needed) functions. Be aware, that there are many more to be found in either the class references or via the builtin class browser.
Reference: Filename
Inhaltsverzeichnis
Queries[Bearbeiten]
exists[Bearbeiten]
Returns true if the file exists.
aFilename exists aFilename.exists() [JS]
Example:
'data.txt' asFilename exists => false
fileSize[Bearbeiten]
Returns the file's size (in bytes). 0 if it does not exist (or is empty).
aFilename fileSize aFilename.fileSize() [JS]
Example:
'data.txt' asFilename fileSize => 0
modificationTime / creationTime / accessTime[Bearbeiten]
Returns the time of the last modification, initial creation and last access of the file. Notice that Unix operating systems do not record a file's creationTime. There, the nil will be returned for creationTime.
aFilename modificationTime aFilename.modificationTime() [JS]
Example:
'/etc' asFilename modificationTime => 2018-07-27 11:37:20 'c:\tmp\test.dat' asFilename modificationTime => 2010-01-27 22:37:20