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

[MacPerl] Filename globbing



I have a script which wants to begin by clearing out all of the
files in a folder, before creating new ones.  On a Unix box, I'd
use:
     unlink("./foo/*");
I altered this for Mac pathnames:
     unlink(":foo:*");
...without success.  But after a few minutes I discovered that
this worked OK:
     unlink(glob ":foo:*");

All was well until I switched to a different folder and the 
unlinking died.  On investigation, the perlop man page says that
globbing "...will not work on filenames with spaces in them unless
you have  csh(1) on your machine."  That was it; the new folder 
had spaces in its name.

Given that installing csh is not really an option, how can
I properly glob filenames in a folder whose name includes
spaces?  (How is globbing implemented in MacPerl anyway?
On Unix systems it uses a shell process).

On a separate note, is there a function that moves things to
the trash rather than just deleting them outright?

Thanks,
Tom

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