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:31:17 -0500


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?





reply via email to

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