Hi,
This is a very good question.
I do not have a good answer, but I am replying here with CC to the
squeak-dev list because I would like to get a response to this question.
In my own personal experience, when I want to traverse the files and
directories, I am in the habit of just using the traditional unix 'find'
utility because it does a very good job of this, and it knows how to
handle file system dependencies such as links and symlinks. I can
use the results of the 'find' command in Squeak, so that works well
for me.
But if I want to traverse a file system tree directly in Squeak, is
there a good simple way to do it? Presumably one would want to visit
each node in the tree and evaluate a block to do something. In the
example below, we would want the block to create an instance of
class Card for each file node that is visited.
For folks replying on squeak-dev please keep in mind that the
question originates from the beginners list, so we are looking
for a clear and simple answer :-)
Thanks,
Dave
On 2023-10-24 18:27, ruivianapereira(a)gmail.com wrote:
> I'm not a programmer of any kind or language; I'm an amateur.
> I have a personal digital library with thousands of documents, which
> are useless unless I manage to classify them.
> I thought it would be an easy task with Squeak, since it is a quite
> simple problem, but I'm lacking some solutions, as a beginner.
> My general cenario:
> I made a class, lets call it card, to hold information about each work,
> each author, their location on disk and the relations between authors
> and works:
> Object>>#Card (instance var : name, location, notes, tags ... ) Author
> Work
Object>>#MyLibrary (instance var : authors <aCollection>, works
<aCollection>, myLibraryBase <aPath?>)
Than I initialize #MyLibrary instances with a UIManager directoryChooser
to establish from the begining a reference to the directory where all
the relevant files are.
But, because it is thousands of files, I would need an automatic method
to «scan» all the relevant files in the directories and subdirectories.
Meaning: the method should make a collection of all the files,
recursively in subdirectories, and for each one it should create a card.
And that's where I got stuck: how do I scan recursively the
subdirectories?
Most of the new tools are quite confusing for me, namely classes and
tools to deal with files.
Can anyone point me in the wright direction, please?
Thanks
_______________________________________________
Beginners mailing list -- beginners(a)lists.squeakfoundation.org
To unsubscribe send an email to
beginners-leave(a)lists.squeakfoundation.org