Directory listing on Mac

Lic. Edgar J. De Cleene edgardec2001 at yahoo.com.ar
Fri Mar 19 11:01:30 UTC 2004


On 18/03/04 18:36, "Brian Murphy-Dye" <brian.murphydye at mac.com> wrote:

> When trying this, #() is returned. The problem seems to be that a
> MacHFSPlusFileDirectory is returned, which wants to use an older
> directory structure [FileDirectory pathNameDelimiter returns $: instead
> of $/].
> 
> 
> On Mar 18, 2004, at 4:30 PM, Colin Putney wrote:
> 
>> 
>> On Mar 18, 2004, at 4:24 PM, Brian Murphy-Dye wrote:
>> 
>>> I see that 'FileDirectory default directoryNames' returns an Array of
>>> directory names located in the image directory. On a Mac OS/X system,
>>> how do I find the directories in the '/Users' directory?
>> 
>> Try something like
>> 
>> (FileDirectory root directoryNamed: 'Users') directoryNames
>> 
>> 
> 
Why don't try this trick ?

| aSuffixList |
    oldFolder _ FileDirectory default pathName.
    newFolder _ FileList2 modalFolderSelector.
    FileDirectory setDefaultDirectory: newFolder pathName.
aSuffixList _#('.gif' '.jpg' '.png' ).


    imagesList _ OrderedCollection new.
    aSuffixList do:
        [:aSuffix | aSuffixList addAll: (FileDirectory default
fileNamesMatching: '*', aSuffix)].
! !
In this case, a modal window let's you navigate all computer and select
correct directory, then could have a list of pictures on selected directory
for example.
Wonks on Mac 9 and X and Windows.
Remember restore the default or Squeak could continue working on selected
directory for all things (like Squeak.log).

Edgar




More information about the Squeak-dev mailing list