(File lastWriteTime: aFilename) asSYSTEMTIME asTimeStamp date

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

(File lastWriteTime: aFilename) asSYSTEMTIME asTimeStamp date

Chris Uppal-3
Is that really the most straight-forward way to get the last modified date (or
time) of a file ?

Seems remarkably convoluted ;-)

Actually, what really I want is UTC Date (and Time), but there doesn't seem to
be a public interface for getting that...

    -- chris


Reply | Threaded
Open this post in threaded view
|

Re: (File lastWriteTime: aFilename) asSYSTEMTIME asTimeStamp date

Ian Bartholomew-19
Chris,

> Is that really the most straight-forward way to get the last modified
> date (or time) of a file ?

Depends what you count as straight-forward.  With a bit more preparation you
can use the scripting component and the slightly more civilised interface it
provides.

tlb := AXTypeLibraryAnalyzer open: 'scrrun.dll'.
tlb prefix: ''.
tlb generateInterfaceWrappers.

..... then

fileSystem := IFileSystem createObject: 'Scripting.FileSystemObject'.
(fileSystem getFile: 'c:\whatever.txt') dateLastModified

.... which answers a TimeStamp

--
Ian

Use the Reply-To address to contact me.
Mail sent to the From address is ignored.