rmdir will only delete empty directories. I assume these directories contain 
files?
   
  Plus I'm not sure that using system() with die works the way you are 
intending. Why not use perl's rmdir (which also only deletes empty dirs).  I'd 
try opendir on the CVS
  directory and unlink all the files in it, then call rmdir() on the CVS 
directory.
   
  Try sticking print statements in it to try to see where it's hanging.
   
  HTH,
  - Travis.

Tommy Nordgren <[EMAIL PROTECTED]> wrote:
  What's wrong with this script for removing the CVS directories from a 
checked-out CVS
workspace?

#!/usr/bin/perl
use strict;
use warnings;

my $mypath = '/Users/emac/gcc';

removecvs( $mypath);

sub removecvs {

my $path = $_[0];

system ('/bin/rmdir',"$path/CVS") or die "Can't remove CVS Directory 
$!";

my $dir;

opendir($dir,$path);

while (defined(my $file = readdir($dir))) {
next if ( ($file eq '.') or ($file eq '..')) ;
if (-d "$path/$file") {
removecvs("$path/$file");
}
}

closedir $dir;
}

any help appreciated.
-------------------------------------
This sig is dedicated to the advancement of Nuclear Power
Tommy Nordgren
[EMAIL PROTECTED]




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





 
---------------------------------
Cheap Talk? Check out Yahoo! Messenger's low  PC-to-Phone call rates.

Reply via email to