in reply to Re^6: Index a file with pack for fast access
in thread Index a file with pack for fast access
I've uploaded the three files I'm using to gist
Why there and not here?
But, this is your error:
open(IN, $oneper) or die "Can't open file $oneper for reading: $!\n"; open(INDEX, ">:raw","$file.idx") or die "Can't open $file.idx for read +/write: $!\n"; syswrite INDEX, pack('N',0),4; while (<IN>) { syswrite INDEX, pack('N', tell INDEX), 4; ##.................................^^^^^ } close INDEX;
You are indexing your index file instead of your datafile.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Index a file with pack for fast access
by Ineffectual (Scribe) on Dec 21, 2011 at 22:30 UTC | |
by BrowserUk (Patriarch) on Dec 21, 2011 at 22:48 UTC |