CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 1999
    Location
    Colombo, Sri Lanka
    Posts
    27

    Merging Binary Files? Is it possible?

    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.



  2. #2
    Join Date
    Apr 1999
    Location
    Netherlands
    Posts
    181

    Re: Merging Binary Files? Is it possible?

    You can open the target file in Append mode and add the stuff you want to save.

    Crazy D @ Work :-)

  3. #3
    Guest

    Re: Merging Binary Files? Is it possible?

    However.. when opening in Append Mode.. does VB treat the stream as pure bytes or a Unicode String? This make a diference...


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured