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, _______________________________________________ Beginners mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/beginners |
On Sunday 21 March 2010 01:52:46 pm Van Upboy wrote:
> 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! Make sure the file exists! Try inspecting each line in the workspace to see if you are using the right path elements. > 2. How can I change creationTime to something readable? Now it is a > LargePositiveInteger, not very useful to display. Time fromSeconds: self creationTime. or Date fromSeconds: self creationTime. will convert time from epoch counts to d/m/y, h:m:s forms. HTH .. Subbu _______________________________________________ Beginners mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/beginners |
Free forum by Nabble | Edit this page |