Hi All

I have files previously created in binmode.

ie,

open SFILE, "filename.dat";
binmode SFILE;
print SFILE $buffer;
close SFILE;


Now, I want to Append this file somewhere in the middle.
my $i = (-s "filename.dat") / 2;
open SFILE, "filename.dat";
binmode SFILE;
seek SFILE $i, 0;
print SFILE $data;
close SFILE;

this does not seem to work.

How do I properly open a file for random read/write?


if I open it with
open SFILE, "filename.dat";
seek SFILE $i, 0;
It does not append.

If I open it with
open SFILE, ">>filename.dat";
seek SFILE $i, 0;
It keeps appending at the end

if I open it with
open SFILE, ">>filename.dat";
seek SFILE $i, 0;
it writes at that location alright, but first half of data are blank.

HELP! :(

Dan
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to