A while back i was trying to do a file compare and it just wasn't working the way i wanted it to. So I decided to do this a different approach.
so what i am doing is bulding an array from two different UNC paths and populating it with file list.
Then what i would like to do is compare one array against the other array and see if any of the files are the same at a binery level. Say somthing like read the first 1000 bytes store it in some sort of 2d array or somthing of that nature. Once the list is built the compare all the files/binary list against eachother and check if there the same file is in both locatons, and if there are any files in one location but not the other.
I started to play with the code and this is as far as I got
my @files = File::Find::Rule->file()->in($logShare);
foreach my $test (@files)
{
open FILE, $test or die $!;
binmode FILE;
my ($buf, $data, $n);
while (($n = read FILE, $data, 1000) != 0) {
print "$n bytes read\n";
print "$test \n";
$buf .= $data;
}
close(FILE);
}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.