Changeset 24449


Ignore:
Timestamp:
2011-08-23T14:06:33+12:00 (11 years ago)
Author:
ak19
Message:

John Thompson improvement to file reading: faster, more efficient way of reading than traditional slurping in of the file (one newline at a time). Will be tested.

File:
1 edited

Legend:

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

    r23484 r24449  
    216216     
    217217    if ($encoding eq "ascii") {
    218     undef $/;
    219     $$textref = <FILE>;
    220     $/ = "\n";
     218    # Replace file 'slurp' with faster implementation
     219    sysread(FILE, $$textref, -s FILE);
     220   
     221    # The old slow way of reading in a file
     222    #undef $/;
     223    #$$textref = <FILE>;
     224    #$/ = "\n";
    221225    } else {
    222226    my $reader = new multiread();
Note: See TracChangeset for help on using the changeset viewer.