Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
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:


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.


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]