Click to See Complete Forum and Search --> : Merging Binary Files? Is it possible?


Robert Fernando
September 29th, 1999, 05:54 AM
Is it possible to merge two binary files while only using one buffer?

E.G.

Read Stuff into ByteArray BA1

Open File 1
Goto EOF File1
Put BA1 into File 1

Close File1




The problem with this is that VB truncates the last character in File1.

One way it does work is when you read both files into two byte arrays, concatenate the arrays and write this back to the file. But if you want to append 2K to a 32MB file this is ridiculous...

Any ideas?

Thanks,

Rob.

Crazy D @ Work
September 29th, 1999, 06:40 AM
You can open the target file in Append mode and add the stuff you want to save.

Crazy D @ Work :-)

September 29th, 1999, 06:57 AM
However.. when opening in Append Mode.. does VB treat the stream as pure bytes or a Unicode String? This make a diference...