• 设为首页  加入收藏
  • 您好,欢迎来虚拟主机评测网 免费收录IDC商家
  • #如何调用
    deleteFolder("test");
    
    #Used to remove a directory which is not empty.
    #the process function.
    sub deleteFolder{
      my $path = $_[0];
      chdir $path;
    
      #get all the files in that directory.
      @_=<*>;
      for(@_){
        if(-d $_){
          #if the destination file is a directory, go recursion.
          deleteFolder($_);
        }else{
          unlink;
        }
      }
    
      #Go up and del the destination directory.
      chdir "../";
      rmdir $path;
    }