#!/usr/bin/perl $fsize = -s $ARGV[0]; open (COR, ">>$ARGV[0]"); for (0..$fsize / 100) { seek(COR, rand($fsize), 0); print COR chr(rand(256)); }; close(COR);
I want it to seek to a random point on the file, and write a random byte there.. But it's writing all the random bytes at the end of the file, and not in the middle of it..
Am I using the wrong function to seek or write to the file?
Thanks..
In reply to corruption. by Punto
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |