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

Re: [MacPerl] MAC Filesystem Help



I am new to MacPerl myself. I am also working on a script that traverses
the Mac filesystem. Instead of making a temp file list, I am building it
around FSpIterateFolder, in the "More Files" extension. Try pulling down
"Help|Mac Toolbox|More Files." By way of concrete example, here's a droplet
that lists the case normalized path, and filename, of every file in any
number of folders that are dropped upon it.

use Mac::MoreFiles;

foreach (@ARGV) { FSpIterateDirectory($_, 0, myDoSpec, ""); }

sub myDoSpec
{
  $fss = shift;
  $_ = FSpGetCatInfo($fss)->ioNamePtr;
  $_ =~ tr/A-Z/a-z/;
  print $_, ", ", $fss, "\n";
  return 0;
}

You might wish to use something like FOpen($fss) (in Mac::Files) to open
your file in a Mac-ish way. I hope you find this useful.

asd@fns.com (Ameet Dhillon) wrote:
>I am new to MacPerl and am having some difficulty finding information to
>answer my questions. I have used Perl on Unix and DOS so I know the language
>fairly well. Any help or advice would be greatly appreciated.

...

>On the MAC I have a folder on the Desktop called "Frads" and this folder
>contains many (probably about 50) files. I want to open each file 1 by
>1 (using a while statement as above) and then operate on the file. I guess the
>main help I need is figuring out how to access the MAC file system so
>I can open each file in the "Frads" folder 1 by 1. I think this should be very
>easy for anyone who has experience using MAC-perl.



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