help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] walking a directory tree


From: Sean Allen
Subject: Re: [Help-smalltalk] walking a directory tree
Date: Fri, 9 Jan 2009 04:48:50 -0500


On Jan 9, 2009, at 4:31 AM, Sean Allen wrote:


On Jan 9, 2009, at 3:58 AM, Paolo Bonzini wrote:

if i do:
file :=  File name: '/Users/Spooneybarger'
file all do: [ :e | e isDirectory ifTrue: [ e directories printNl ] ]

i get no output other than: "Global garbage collection... done, heap grown"
over and over and over

The problem here is that every file that you get in "file all do:" is in
turn a RecursiveFileWrapper.  In other words what you wanted was just

 file all directories do: [ :each | each printNl ]

(try "file all directories").

I haven't applied you patch yet, as I want to understand how it would be without the patch, ( I'm the curious sort like that... ) and I didn't get what I would except from your example:

st> ( File name: '/Users/Spooneybarger' ) all directories do: [ :each | each printNl ]
"Global garbage collection... done"
"Global garbage collection... done, heap grown"
"Global garbage collection... done, heap grown"
"Global garbage collection... done, heap grown"
"Global garbage collection... done, heap grown"
...snip...

What am I doing wrong?



Ok ten minutes later, after ton of garbage collection message it suddenly returned a mass of output. So, suddenly it makes sense, its getting all the directories then outputting the information so because there are a ton of directories under that one... gc gets called over and over and it
takes a long time to process...

Sorry, I shouldn't have assumed after just a minute that it wasnt going to return anything and that I still had it wrong...







reply via email to

[Prev in Thread] Current Thread [Next in Thread]