[Top][All Lists]

[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: Sat, 10 Jan 2009 10:30:33 -0500

On Jan 9, 2009, at 4:44 AM, Paolo Bonzini wrote:

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 ] ]

What am I doing wrong?

"file all do:" is doing an "ls -lR" which is already slow. :-)

Since without my patch "e" is in turn a RecursiveFileWrapper (the kind
of object returned by #all), each send of #directories in the block
would in turn invoke a recursive descent. So that's a loop of "ls - lR"s
inside an "ls -lR", and it's going to take a while. :-)  Actually it's
going to be infinite, because sooner or later you'll do "e directories"
on "/Users/Spooneybarger/..".

this finally makes sense to me. thank you for the patch Paolo.
I'm slowly starting to see how all the FilePath stuff works and the
Recursive stuff is starting to make sense.

At first I would read what you wrote and it made sense in a way
but not really, once you start throwing input at methods and see what comes
out, then it starts to click.

reply via email to

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