in reply to Re: Filling a File with While
in thread Filling a File with While

I do want to know the size of the file on disk, how can I create a 1 gig file using the File::System::Object? I can see the blksize and blocks, so should I being doing something more like this:

while ($v->get_property('block') < $bcount) { print $fh "Some Something "; }

Where $bcount is the number of blocks I need to make up a 1 gig file? roughly 262,144 blocks right?

Does the $fh have to be closed before I check the block size?

while ($v->get_property('block') < $bcount) { $fh = $v->open('w'); print $fh "Some Something "; close $fh; }