Filename API Functions: Unterschied zwischen den Versionen

Aus expecco Wiki (Version 25.x)
Zur Navigation springen Zur Suche springen
Inhalt gelöscht Inhalt hinzugefügt
Zeile 18: Zeile 18:
'data.txt' asFilename exists
'data.txt' asFilename exists
=> false
=> false

===== isReadable / isWritable / isExecutable =====
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 =====
===== fileSize =====
Returns the file's size (in bytes). 0 if it does not exist (or is empty).
Returns the file's size (in bytes). 0 if it does not exist (or is empty).

Version vom 28. Juli 2019, 09:39 Uhr

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

exists

Returns true if the file exists.

aFilename exists

aFilename.exists() [JS]

Example:

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

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

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

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