[Newbies] Squeak equivalent for Filename

Bert Freudenberg bert at freudenbergs.de
Sun Dec 23 19:02:46 UTC 2007


On Dec 23, 2007, at 19:02 , Doug Edmunds wrote:

> Bert Freudenberg wrote:
>> On Dec 23, 2007, at 7:51 , Doug Edmunds wrote:
>>
>>> Cincom VisualWorks has this code to read the names of the
>>> files in a directory:
>>>
>>> (Filename named: '.') directoryContents   "returns an array of  
>>> string"
>>>
>>> What is the equivalent in Squeak?
>>
>> (FileDirectory on: '.') fileAndDirectoryNames
>>
> Didn't work. I get a walkback
> "Error: Fully qualified path expected"


Well, '.' was just a place holder. You need to give a full path.

Squeak does not have a notion of a "current working directory". Try  
this instead:

FileDirectory default fileAndDirectoryNames

... which usually refers to the directory the image is in.

- Bert -




More information about the Beginners mailing list