in reply to How to inset "+" symbol in binary files ?
Uhm, the same way as you do in non-binary files? If the file
is small: open the file read/write, read in the file (in a scalar), insert "+" wherever you want it,
seek back to the beginning of the file, write the scalar,
close the file. If the file is large, open a temporary file
for writing, open the original file for reading, read from
the file up to the point where you want to insert the "+"
while writing what you've read (in chunks) to the temporary
file, write "+" to temporary file, read rest of file while
writing it to the temporary file, close both files, move
temporary file to original file.
Abigail
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: How to inset "+" symbol in binary files ?
by tcf22 (Priest) on Mar 24, 2004 at 15:07 UTC | |
by amw1 (Friar) on Mar 24, 2004 at 15:09 UTC | |
by tcf22 (Priest) on Mar 24, 2004 at 15:20 UTC | |
by Anonymous Monk on Mar 25, 2004 at 06:48 UTC |
In Section
Seekers of Perl Wisdom