Changeset 27578

Show
Ignore:
Timestamp:
07.06.2013 18:07:01 (6 years ago)
Author:
ak19
Message:

Doing a sort on all occurrences of readdir, so readdir lists dir contents in a consistent order across operating systems.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/DirectoryPlugin.pm

    r27306 r27578  
    322322    return -1; # error in processing 
    323323    } 
    324     @dir = readdir (DIR); 
     324    @dir = sort readdir (DIR); 
    325325    closedir (DIR); 
    326326     
     
    407407    return -1; # error in processing 
    408408    } 
    409     @dir = readdir (DIR); 
     409    @dir = sort readdir (DIR); 
    410410    map { $_ = &unicode::raw_filename_to_url_encoded($_) } @dir; 
    411411    closedir (DIR); 
     
    514514        # Re-read the files in the directory to see if there are any new files 
    515515        last if (!opendir (DIR, $dirname)); 
    516         my @dirnow = readdir (DIR); 
     516        my @dirnow = sort readdir (DIR); 
    517517        map { $_ = &unicode::raw_filename_to_url_encoded($_) } @dirnow; 
    518518        closedir (DIR);