Changeset 16436
- Timestamp:
- 2008-07-16T17:04:14+12:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/util.pm
r16404 r16436 927 927 928 928 929 # A method to check if a directory is empty (note that an empty directory still has non-zero size!!!) 930 # Code is from http://episteme.arstechnica.com/eve/forums/a/tpc/f/6330927813/m/436007700831 931 sub is_dir_empty 932 { 933 my ($path) = @_; 934 opendir DIR, $path; 935 while(my $entry = readdir DIR) { 936 next if($entry =~ /^\.\.?$/); 937 closedir DIR; 938 return 0; 939 } 940 closedir DIR; 941 return 1; 942 } 943 929 944 1;
Note:
See TracChangeset
for help on using the changeset viewer.