SPUG: scanning directories

Brittingham, John john.brittingham at attws.com
Thu Nov 30 00:39:18 CST 2000


Ok.. I'm having a problem deleting files. I have tried:

$oldfile="../html/wrt_archive/weekly_archive/*to$twodaysback*\.*";
		if ($week_day !~ /Mon/) 
		{
			print "$oldfile\n";
			rm ($oldfile) || warn "having trouble deleting
$oldfile: $!";
		}

 I have also tried:
	
$oldfile="../html/wrt_archive/weekly_archive/*to$twodaysback*\.*";
		if ($week_day !~ /Mon/) 
		{
			unlink <$oldfile> || warn "having trouble deleting
$oldfile: $!";
		}

I keep getting an error saying it can not find the file(s).
I can run rm ../html/wrt_archive/weekly_archive/*to$twodaysback*\.* from the
command line and it will work.

What am I doing wrong?

-----Original Message-----
From: Daniel Jacobs [mailto:danielj at cheshirecat.net]
Sent: Wednesday, November 29, 2000 10:16 PM
To: spug-list at pm.org
Subject: Re: SPUG: scanning directories


Do you possibly need to escape the '/' characters? i.e.

$portal{BASEDIR} = "\/\/machinename\/sharedirectory";   

On Thu, 30 Nov 2000, Menardo, Dax wrote:

> first of all its a Windows environment - booooo, i hear some say.....
> 
> How do I scan through an unmapped share directory name on a server on the
> network domain? or even open one.....
> 
> Lets say:
> 
> $portal{BASEDIR} = "//machinename/sharedirectory";
> opendir(ETC,$portal{BASEDIR}) || die "\nCannot opendir
".$portal{BASEDIR}."
> \n$!";
> 
> eventhough the share permission is set to be read/write/execute for
> everyone.... the interpreter chucks out an error "cannot open the
directory
> <blah, blah>".....
> 
> Any Ideas....
> 
> 
> 
Daniel Jacobs | danielj at cheshirecat.net | Internet & Unix Consulting
         "In art and dream, may you proceed with abandon.
 In life, may you proceed with balance and stealth." - Patti Smith



 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
  Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
  Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/





More information about the spug-list mailing list