Re: rmdir

2011-06-28 Thread Irfan Sayed
Awsome!!! this works fine . Rob you rock thanks a lot. --irfan From: Rob Dixon To: Perl Beginners Cc: Irfan Sayed Sent: Monday, June 27, 2011 11:54 PM Subject: Re: rmdir On 24/06/2011 10:43, Irfan Sayed wrote: > > i need to delete some direc

Re: rmdir

2011-06-27 Thread Rob Dixon
? Your code should delete the folder named in $hash_fin{$key} and everything beneath it. The tree down to 'zoc' should remain unchanged. Setting safe to true won't help - all it does is prevent remove_tree from altering file permissions in order to delete elements in the tree. Note that \\

RE: rmdir

2011-06-27 Thread Ken Slater
> From: Irfan Sayed > To: Perl Beginners > Sent: Friday, June 24, 2011 3:13 PM > Subject: rmdir > > hi, > i need to delete some directories recursively which are present at some > shared location > > i tried file::path perl module but the issue with that module

Re: rmdir

2011-06-27 Thread Ron Bergin
es are getting deleted and not empty folders > > plz suggest > > > > > > From: Ron Bergin > To: Irfan Sayed > Cc: Shlomi Fish ; "pa...@laposte.net" > ; Perl Beginners > Sent: Monday, June 27, 2011 8:39 PM > Subject:

Re: rmdir

2011-06-27 Thread Irfan Sayed
est From: Ron Bergin To: Irfan Sayed Cc: Shlomi Fish ; "pa...@laposte.net" ; Perl Beginners Sent: Monday, June 27, 2011 8:39 PM Subject: Re: rmdir Irfan Sayed wrote: > even i tried windows del command > but it prompts for confirmation to dele

RE: rmdir

2011-06-27 Thread Park, KwanSeon
? Thanks Kwan -Original Message- From: Ron Bergin [mailto:r...@i.frys.com] Sent: Monday, June 27, 2011 10:09 AM To: Irfan Sayed Cc: Shlomi Fish; pa...@laposte.net; Perl Beginners Subject: Re: rmdir Irfan Sayed wrote: > even i tried windows del command > but it prompts for confi

Re: rmdir

2011-06-27 Thread Ron Bergin
Irfan Sayed wrote: > even i tried windows del command > but it prompts for confirmation to delete the files > do u know how to suppress these prompts ? i did not find any switch which > allows you to suppress > > pls suggest. > > regards > irfan > You need to use the /s and /q and /f options. /

Re: rmdir

2011-06-27 Thread Irfan Sayed
nners@perl.org" Sent: Monday, June 27, 2011 7:22 PM Subject: Re: rmdir On Mon, Jun 27, 2011 at 3:49 PM, Irfan Sayed wrote: exactly. some of the files have set the attribute as read only > >and due to that module was unable to delete those > >is there any module which will chec

Re: rmdir

2011-06-27 Thread Shlomi Fish
', '-fr', $path); Regards, Shlomi Fish > > > > > Message du 27/06/11 14:23 > > De : "Shlomi Fish" > > A : pa...@laposte.net > > Copie à : "Irfan Sayed" , "Perl Beginners" > > Objet : Re: rmdir &g

Re: rmdir

2011-06-27 Thread Rob Coops
ttribute?? > > plz suggest > > --irfan > > > > > From: Shawn H Corey > To: beginners@perl.org > Sent: Monday, June 27, 2011 6:09 PM > Subject: Re: rmdir > > On 11-06-27 08:29 AM, Irfan Sayed wrote: > > even i tried win

Re: rmdir

2011-06-27 Thread Irfan Sayed
Corey To: beginners@perl.org Sent: Monday, June 27, 2011 6:09 PM Subject: Re: rmdir On 11-06-27 08:29 AM, Irfan Sayed wrote: > even i tried windows del command > but it prompts for confirmation to delete the files > do u know how to suppress these prompts ? i did not find any swi

Re: rmdir

2011-06-27 Thread Rob Coops
"execvp", which is more efficient. > > > > > > Message du 27/06/11 14:23 > > De : "Shlomi Fish" > > A : pa...@laposte.net > > Copie à : "Irfan Sayed" , "Perl Beginners" > > Objet : Re: rmdir > > > >

Re: rmdir

2011-06-27 Thread Shawn H Corey
On 11-06-27 08:29 AM, Irfan Sayed wrote: even i tried windows del command but it prompts for confirmation to delete the files do u know how to suppress these prompts ? i did not find any switch which allows you to suppress It sounds like some of the files or directories have their read-only b

Re: rmdir

2011-06-27 Thread pangj
" > A : pa...@laposte.net > Copie à : "Irfan Sayed" , "Perl Beginners" > Objet : Re: rmdir > > Hi Pangj, > > On Mon, 27 Jun 2011 14:07:51 +0100 > pa...@laposte.net wrote: > > > > > Won't system "rm -rf /path/to/dir"

Re: rmdir

2011-06-27 Thread Irfan Sayed
: Irfan Sayed ; Perl Beginners Sent: Monday, June 27, 2011 5:53 PM Subject: Re: rmdir Hi Pangj, On Mon, 27 Jun 2011 14:07:51 +0100 pa...@laposte.net wrote: > > Won't system "rm -rf /path/to/dir" just work for you? > 1. This is on Windows, so "rm" may not be avail

Re: rmdir

2011-06-27 Thread Shlomi Fish
Hi Irfan, On Mon, 27 Jun 2011 04:59:29 -0700 (PDT) Irfan Sayed wrote: > i did that but no luck > is there any another way ? What did you do? What did you try? What happened? Did you try using the error flags like I told you or perl -d? What happens when you are using them? Please copy and paste

Re: rmdir

2011-06-27 Thread Shlomi Fish
form of system: system("rm", "-fr", $path); With the string version, you're risking code injection: http://shlomif-tech.livejournal.com/35301.html Regards, Shlomi Fish > > > > Message du 27/06/11 13:59 > > De : "Irfan Sayed" > >

Re: rmdir

2011-06-27 Thread pangj
Won't system "rm -rf /path/to/dir" just work for you? > Message du 27/06/11 13:59 > De : "Irfan Sayed" > A : "Shlomi Fish" > Copie à : "Perl Beginners" > Objet : Re: rmdir > > i did

Re: rmdir

2011-06-27 Thread Irfan Sayed
i did that but no luck is there any another way ? regards irfan From: Shlomi Fish To: Irfan Sayed Cc: Perl Beginners Sent: Monday, June 27, 2011 5:05 PM Subject: Re: rmdir Shlomi Fish (shlo...@shlomifish.org) added themselves to your Guest List

Re: rmdir

2011-06-27 Thread Shlomi Fish
Hi Irfan, On Fri, 24 Jun 2011 02:43:34 -0700 (PDT) Irfan Sayed wrote: > > > hi, > i need to delete some directories recursively which are present at some > shared location > > i tried file::path perl module but the issue with that module is , it is not > deleting the root/parent dir > > it

Re: rmdir

2011-06-27 Thread Irfan Sayed
plz suggest . i am stuck From: Irfan Sayed To: Perl Beginners Sent: Friday, June 24, 2011 3:13 PM Subject: rmdir hi, i need to delete some directories recursively which are present at some shared location i tried file::path perl module but the issue

Re: rmdir

2011-06-24 Thread Chris Charley
"Irfan Sayed" wrote in message news:1308908614.88998.yahoomail...@web125518.mail.ne1.yahoo.com... hi, i need to delete some directories recursively which are present at some shared location i tried file::path perl module but the issue with that module is , it is not deleting the root/p

rmdir

2011-06-24 Thread Irfan Sayed
hi, i need to delete some directories recursively which are present at some shared location i tried file::path perl module but the issue with that module is , it is not deleting the root/parent dir it deletes the subdirectories and all the files inside that but not removing root dir here i

Re: rmdir

2005-02-01 Thread Ing. Branislav Gerzo
Mariano Cunietti [MC], on Tuesday, February 01, 2005 at 16:19 (+0100) typed: MC> I was wondering if there is anybody who can show me the *correct* way to MC> use a fast pattern-search-and-assign. MC> I mean: I am extracting viertual aliases from a postfix config file: 1. you did not change subjec

Re: rmdir

2005-02-01 Thread Mariano Cunietti
Hi, I was wondering if there is anybody who can show me the *correct* way to use a fast pattern-search-and-assign. I mean: I am extracting viertual aliases from a postfix config file: # cannot use 'split' function, some statements in the second field may contain whitespaces (e.g. ERROR "blah blah

Re: rmdir

2005-02-01 Thread Ing. Branislav Gerzo
[EMAIL PROTECTED] [d], on Tuesday, February 1, 2005 at 09:58 (-0500) thinks about: d> I want to delete the files from a directory then delete the directory. use File::Path; $remove = 'C:\temp'; rmtree($remove) if -e $remove; more @ http://search.cpan.org/~nwclark/perl-5.8.6/lib/File/Path.pm --

rmdir

2005-02-01 Thread dsimmons
          opendir(DIR, $fname) || print "no $fname directory!\n";         $wait = ;                 while ($name = readdir(DIR)) {            print "$name\n";            $name = $fname."\\".$name;            unlink($name);            print "$name\n";      

RE: Why is unlinking a directory bad or worse then rmdir

2003-10-02 Thread TN
Using unlink may do what you want...and more in terms of unexpected side effects later on that could have dire consequences. For that reason on most Unix systems the use of unlink (and unlink()) requires root access and the use of rmdir (and rmdir()) is strongly encouraged because it permits only

Re: Why is unlinking a directory bad or worse then rmdir

2003-10-01 Thread Wiggins d'Anconia
use unlink. I should use rmdir. However rmdir does not work unless the > > directory is empty Should I just system rm -r > > Why not? If that does what you want, use it. > > The XP people (that's Extreme Programming) will tell you to "Do the > simplest thing th

Re: Why is unlinking a directory bad or worse then rmdir

2003-10-01 Thread Paul Johnson
On Wed, Oct 01, 2003 at 03:54:25PM -0400, Paul Kraus wrote: > I need to do recursive deletes. But according to perldoc I should not > use unlink. I should use rmdir. However rmdir does not work unless the > directory is empty Should I just system rm -r Why not? If that does

Re: Why is unlinking a directory bad or worse then rmdir

2003-10-01 Thread David T-G
Paul -- ...and then Paul Kraus said... % % I need to do recursive deletes. But according to perldoc I should not % use unlink. I should use rmdir. However rmdir does not work unless the Yep. The short form: A directory contains pointers to all of the files "in" it. If you unlink the

RE: Why is unlinking a directory bad or worse then rmdir

2003-10-01 Thread Wiggins d'Anconia
On Wed, 1 Oct 2003 15:54:25 -0400, "Paul Kraus" <[EMAIL PROTECTED]> wrote: > I need to do recursive deletes. But according to perldoc I should not > use unlink. I should use rmdir. However rmdir does not work unless th

Why is unlinking a directory bad or worse then rmdir

2003-10-01 Thread Paul Kraus
I need to do recursive deletes. But according to perldoc I should not use unlink. I should use rmdir. However rmdir does not work unless the directory is empty Should I just system rm -r >From perldoc unlink L

Re: FW: rmdir

2001-09-26 Thread Scott P
> From: Michael Fowler [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, June 27, 2001 5:27 PM > To: Me > Cc: Porter, Chris; [EMAIL PROTECTED] > Subject: Re: FW: rmdir > > On Wed, Jun 27, 2001 at 03:51:43PM -0500, Me wrote: > > Basically, you have to write a sub that does the >

RE: FW: rmdir

2001-09-26 Thread Porter, Chris
Please remove me from the mailing list. Thank you. Chris -Original Message- From: Michael Fowler [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 27, 2001 5:27 PM To: Me Cc: Porter, Chris; [EMAIL PROTECTED] Subject: Re: FW: rmdir On Wed, Jun 27, 2001 at 03:51:43PM -0500, Me wrote

Re: FW: rmdir

2001-06-28 Thread Me
> On Thu, Jun 28, 2001 at 09:49:32AM -0400, Porter, Chris wrote: > > Still unsure how to approach. > > Or you could use File::Path::rmtree. I'm surprised no one has given this > > answer yet. And, in case it makes you more comfortable with doing this in any particular way, I wholeheartedly reco

Re: FW: rmdir

2001-06-28 Thread Michael Fowler
On Thu, Jun 28, 2001 at 09:49:32AM -0400, Porter, Chris wrote: > Still unsure how to approach. Very new to perl and I don't want to screw > this up. Any input from you would be great. Thank you. > > -Original Message- > From: Michael Fowler [mailto:[EMAIL PROTECTED]] > > Or you could u

RE: FW: rmdir

2001-06-28 Thread Porter, Chris
EMAIL PROTECTED] Subject: Re: FW: rmdir On Wed, Jun 27, 2001 at 03:51:43PM -0500, Me wrote: > Basically, you have to write a sub that does the > following sort of thing (ignoring your wrinkle that > you don't want to delete all the files in the initial > directory): Or you could

Re: FW: rmdir

2001-06-27 Thread Michael Fowler
On Wed, Jun 27, 2001 at 03:51:43PM -0500, Me wrote: > Basically, you have to write a sub that does the > following sort of thing (ignoring your wrinkle that > you don't want to delete all the files in the initial > directory): Or you could use File::Path::rmtree. I'm surprised no one has given t

Re: FW: rmdir

2001-06-27 Thread Me
> PC> chdir "/u131/tmp" or die $!; > PC> opendir(HERE, '.'); > PC> @AllFiles = readdir(HERE); > PC> foreach $Name (@AllFiles) { > PC>if (-f $Name) {next} > PC>if ((-d $Name) and ($Name =~ /^[A-Z]+$/)) {rmdi

FW: FW: rmdir

2001-06-27 Thread Porter, Chris
-Original Message- From: Porter, Chris Sent: Wednesday, June 27, 2001 9:21 AM To: 'Maxim Berlin' Subject: RE: FW: rmdir Hi, It's working great. Thank you. But one more thing, it's removing all the empty directories but what about directories with files in them.

Re: FW: rmdir

2001-06-26 Thread Maxim Berlin
Hello Chris, Tuesday, June 26, 2001, Porter, Chris <[EMAIL PROTECTED]> wrote: PC> It's me again, still won't work. Here is the whole script: PC> Again, any help would be great. Well, script works correct now. May be you try to rmdir not empty subdirs? c:\>perldoc -f

FW: rmdir

2001-06-26 Thread Porter, Chris
It's me again, still won't work. Here is the whole script: Again, any help would be great. Thanks. chdir "/u131/tmp" or die $!; opendir(HERE, '.'); @AllFiles = readdir(HERE); foreach $Name (@AllFiles) { if (-f $Name) {next} if ((-d $Name) and

Re: rmdir

2001-06-26 Thread Maxim Berlin
this PC> directory. Make sense. PC> Here is my script, looks like it's working but it's not removing all the PC> directories PC> opendir(HERE, '.'); PC> @AllFiles = readdir(HERE); PC> foreach $Name (@AllFiles) { PC>if (-f $Name) {next} PC>if

rmdir

2001-06-26 Thread Porter, Chris
ng all the directoriesopendir(HERE, '.'); @AllFiles = readdir(HERE); foreach $Name (@AllFiles) { if (-f $Name) {next} if ((-d $Name) and ($Name =~ /^[A-Z]+$/)) {rmdir '$Name'} Thanks. Chris