Filename API Functions

Aus expecco Wiki (Version 2.x)
Zur Navigation springen Zur Suche springen

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

Back to Useful API Functions

Queries[Bearbeiten]

exists[Bearbeiten]

Returns true if the file exists.

aFilename exists

aFilename.exists() [JS]

Example:

 'data.txt' asFilename exists
 => false
isReadable / isWritable / isExecutable[Bearbeiten]

Returns a boolean.
Notice that ïsExecutable" has a special meaning for folders (refer to your Unix/Windows operating system manual).

aFilename isReadable

aFilename.isReadable() [JS]

Example:

 'data.txt' asFilename isReadable
 => 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



Copyright © 2014-2024 eXept Software AG