Subbu, thanks for the hint to look for the directoryEntry.
I have working code (see example).
When I inspect aFile then the other variables are there (for instance, there
is a creationTime which contains a number, and there is a fileSize).
But the fileSize = 0.
1. What is going wrong with the fileSize, because the file is much bigger
than 0!
2. How can I change creationTime to something readable? Now it is a
LargePositiveInteger, not very useful to display.
| aFileDir aFile |
aFileDir := (FileDirectory default directoryNamed: 'mytestdir').
aFile := aFileDir directoryEntryFor: 'my test file.mp3'.
Transcript cr;show: aFile creationTime printString.
Transcript cr;show: aFile fileSize printString.
Regards,
Van.
Hi,
>
> I'm listing files in a directory, but I want to show more than just the
> filename (like file size and may be creation date). I've searched for some
> time on the Internet, but I can't find the answer. How to do this?
>
> I've tried this:
> aFile := (FileDirectory default directoryNamed: directoryName)
> assureExistence;
> readOnlyFileNamed: 'testfile.pdf'.
> and then tried: aFile size but that doesn't seem to work.
>
> Regards,
> Van.
>