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
? 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 \\
> 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
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:
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
?
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
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.
/
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
', '-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
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
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
"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
> >
> >
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
"
> 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"
: 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
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
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"
> >
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
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
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
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
"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
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
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
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
[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
--
opendir(DIR,
$fname) || print "no $fname directory!\n";
$wait
= ;
while
($name = readdir(DIR)) {
print "$name\n";
$name = $fname."\\".$name;
unlink($name);
print "$name\n";
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
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
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
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
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
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
> 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
>
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
> 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
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
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
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
> 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
-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.
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
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
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
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
45 matches
Mail list logo