Reputation: 15477
I am developing an application in vb6.In my application i am trying to copy various files in a single file.The problem is i am trying to read 1000 bytes from the source file and write it to the target file in reverse order.Then another 1000 bytes and so on until i reach the last of the source file.I did similar type of work in java using file pointer.But here i am not finding the solution.Please help.
Upvotes: 1
Views: 1291
Reputation: 186
You could create a buffer for this purpose. Here is some code to get you started. (I don't have vb6 at this moment so the code is not verified)
Example Code:
Dim Buffer As String * 1000
Open "C:\Windows\FileName.txt" For Binary As #1
Get #1, 1, Data
Close #1
Moreover in your case you will need to keep track of the position in the file
Get #file handle, position, Buffer
Also use Put to write the read buffer to another file.
Put #file handle, position, Buffer
Upvotes: 1
Reputation: 12630
This tutorial covers how to read and write from binary files, there is a section about reading blocks of data from a file.
Upvotes: 1