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 LIST                                               
                                                                 
       unlink  Deletes a list of files.  Returns the number of   
               files successfully deleted.                       
                                                                 
                   $cnt = unlink 'a', 'b', 'c';                  
                   unlink @goners;                               
                   unlink <*.bak>;                               
                                                                 
               Note: `unlink' will not delete directories unless 
               you are superuser and the -U flag is supplied to  
               Perl.  Even if these conditions are met, be warned
               that unlinking a directory can inflict damage on  
               your filesystem.  Use `rmdir' instead.            
                                                                 
               If LIST is omitted, uses `$_'.                    
bash-2.03$ perldoc -f rmdir                                      
       rmdir FILENAME                                            
                                                                 
       rmdir   Deletes the directory specified by FILENAME if    
               that directory is empty.  If it succeeds it       
               returns true, otherwise it returns false and sets 
               `$!' (errno).  If FILENAME is omitted, uses `$_'. 


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

Reply via email to