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

[MacPerl] FSpIterateDirectory not working?



I recently discovered the procedure in Mac::MoreFiles called 
FSpIterateDirectory, which is supposed to walk through a specified 
directory and call a specified subroutine for each file. I've tried the 
following code:
-----
#!/usr/bin/perl

#walker!

use Mac::MoreFiles;
FSpIterateDirectory (":",0,DoThis,dummy);
print "\nFinished\n\n";

sub DoThis {
 print "Information returned: @_\n";
	}
-----

This should return the filename of all files and folders (and files 
within subfolders) inside the current directory. It runs without error 
messages, but it seems to return information only about the first file in 
the current directory. All other files are ignored.

I see in the archives that Aaron Munter asked about FSpIterateDirectory 
back in April 1997, but it appears he never got an answer!

So, has anyone had any luck getting  FSpIterateDirectory to work? Has 
anyone even tried it before? I was about to write a module to do this, 
and was happy to see one included in MacPerl.

...but bummed when I tried to make sense of the documentation.

It sure seems a shame if I have to write a reiterative walking module if 
there's one already available :-)

Jim

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch