P
Patrick Cotner
I've written a short perl script which scan an accidentally (or
stupidly) initialised harddrive for lost files. Here is the code i
have thus far (note that the drive I'm scanning is *not* the drive I
intend to parse once the program is complete...it's just for testing):
# This program is *not* finished. All it does now is read lines from
the
# HD and prints them to the terminal window.
use warnings;
use strict;
open (DRIVE, "/dev/disk1s9") || die "Whoops! $!";
while (<DRIVE>) {
print $_;
}
# End of program
Ok, it's not much anything. I'll figure the rest out on my own
(hopefully), but what I need for now is a way to span large (and
mostly empty) chunks of HD that don't contain \n. Is there a way to
skip to the next line in a file if the first x characters of the
current line don't contain what I'm looking for without reading the
entire string (which can be >1gb at times)?
Any help would be appreciated. I just need to be pointed in the right
direction.
Thanks,
Patrick
stupidly) initialised harddrive for lost files. Here is the code i
have thus far (note that the drive I'm scanning is *not* the drive I
intend to parse once the program is complete...it's just for testing):
# This program is *not* finished. All it does now is read lines from
the
# HD and prints them to the terminal window.
use warnings;
use strict;
open (DRIVE, "/dev/disk1s9") || die "Whoops! $!";
while (<DRIVE>) {
print $_;
}
# End of program
Ok, it's not much anything. I'll figure the rest out on my own
(hopefully), but what I need for now is a way to span large (and
mostly empty) chunks of HD that don't contain \n. Is there a way to
skip to the next line in a file if the first x characters of the
current line don't contain what I'm looking for without reading the
entire string (which can be >1gb at times)?
Any help would be appreciated. I just need to be pointed in the right
direction.
Thanks,
Patrick