Subversion Repositories DevTools

Rev

Rev 325 | Rev 379 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 325 Rev 361
Line 42... Line 42...
42
#   For historical reasons many of these variabeles are global
42
#   For historical reasons many of these variabeles are global
43
#
43
#
44
 
44
 
45
package FileUtils;
45
package FileUtils;
46
use base qw(Exporter);
46
use base qw(Exporter);
-
 
47
use File::Path;
47
 
48
 
48
use JatsError;
49
use JatsError;
49
use Cwd;
50
use Cwd;
50
our (@EXPORT, @EXPORT_OK, %EXPORT_TAGS, $VERSION);
51
our (@EXPORT, @EXPORT_OK, %EXPORT_TAGS, $VERSION);
51
 
52
 
Line 70... Line 71...
70
                FileIsNewer
71
                FileIsNewer
71
                DisplayPath
72
                DisplayPath
72
                TruePath
73
                TruePath
73
                FileCreate
74
                FileCreate
74
                FileAppend
75
                FileAppend
-
 
76
                RmDirTree
75
 
77
 
76
                $ScmPathSep
78
                $ScmPathSep
77
                $ScmDirSep
79
                $ScmDirSep
78
                $Cwd
80
                $Cwd
79
                $CwdDrive
81
                $CwdDrive
Line 851... Line 853...
851
        $path =~ s~/~\\~g;
853
        $path =~ s~/~\\~g;
852
    }
854
    }
853
    return $path;
855
    return $path;
854
}
856
}
855
 
857
 
-
 
858
#-------------------------------------------------------------------------------
-
 
859
# Function        : RmDirTree
-
 
860
#
-
 
861
# Description     : Delete a directory tree
-
 
862
#                   Really delete it. Allow for users to remove directory
-
 
863
#                   without search permissions under unix.
-
 
864
#
-
 
865
#                   Can also delete a file
-
 
866
#
-
 
867
# Inputs          : $path                   - Path to directory
-
 
868
#
-
 
869
# Returns         : 1                       - Still there
-
 
870
#
-
 
871
sub RmDirTree
-
 
872
{
-
 
873
    my ($path) = @_;
-
 
874
    rmtree( $path );
-
 
875
    if ( -e $path )
-
 
876
    {
-
 
877
        Verbose3 ("RmDirTree: Directory still exists. Change permissions: $path");
-
 
878
        system ("$ENV{GBE_BIN}/chmod", '-R', 'u+wrx', $path);
-
 
879
        rmtree( $path );
-
 
880
    }
-
 
881
    return ( -e $path );
-
 
882
}
-
 
883
 
856
1;
884
1;
857
 
885
 
858
 
886