Filename API Functions: Unterschied zwischen den Versionen

Aus expecco Wiki (Version 2.x)
Zur Navigation springen Zur Suche springen
(Die Seite wurde neu angelegt: „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 bui…“)
 
Zeile 29: Zeile 29:
'data.txt' asFilename fileSize
'data.txt' asFilename fileSize
=> 0
=> 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

Version vom 28. Juli 2019, 09:36 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[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



Copyright © 2014-2024 eXept Software AG