
perl4me2
New User
Jan 20, 2009, 2:28 AM
Post #2 of 2
(544 views)
|
|
Re: [perl4me2] Strange MD5 behaviour
[In reply to]
|
Can't Post
|
|
Solved... a very stupid mistake to make... $buffer = ""; seek (INF,$position,0); $fsize = read (INF, $buffer, $size, $position); When reading a binary block from a file, seek is not broken, but you can't use a position parameter at both functions, if you do you're buffer will get pre-pended with zero bytes until the start of the data read. Ie. read with position 100: 0,0,0,0,0,0,0,0(up to 99) then the data read. (this way a md5 always fails and the buffer gets larger and larger) $buffer = ""; seek (INF,$position,0); $fsize = read (INF, $buffer, $size); This works  me happy camper.
|