FileDirectory
Last updated at 2:55 pm UTC on 16 January 2006
From the class comment:
A FileDirectory represents a folder or directory in the underlying platform's file system. It carries a fully-qualified path name for the directory it represents, and can enumerate the files and directories within that directory.
A FileDirectory can be thought of as a Dictionary whose keys are the local names of files in that directory, and whose values are directory "entries". Each entry is an array of five items:
- name
- creationTime
- modificationTime
- dirFlag
- fileSize
The times are given in seconds, and can be converted to a time and date via Time>dateAndTimeFromSeconds:. See the comment in lookupEntry:... which provides primitive access to this information.
- FileDirectory default gives back a platform specific directory object (of a subclass of FileDirectory) denoting the directory where the image is in.
- FileDirectory default pathName gives back a string denoting the default directory.
see also:
Example
From: goran.hultgren@bluefish.se
Date: Wed, 7 Nov 2001 12:23:50 +0100
dir := FileDirectory on: 'd:\\images'. "add some image files to this
directory first"
dir keysDo: [:name |
form = Form fromBinaryStream: (dir fileNamed: name).
ImageReadWriter
putForm: (form scaledToSize: 512@512) onFileNamed: 'scaled_',name;
putForm: (form scaledToSize: 80@80) onFileNamed: 'thumb_',name]