-
Okay, my problem is that I make a new header for a file, reading info from old one. But after the header, I should copy many megabytes of data. So what do you suggest?
Just asking this ready for future use, I know I will need this info a lot, atleast for a while.
-
Open both files syncronous, create the new header (Put the header data, (the location will move automatically to the huge data section) Use Get at the position of the old file huge data section (header legnth + 1, i guess) And Get the huge data from old file into a byte array, then put it in the new file and close both.
-
Limit
I've Visual Basic 4 and it seems to have size limit with arrays. I've thought that can I do straight copy or is it have to copy data first into array and then in to the other file?
-
There's a statement for copying file called Filecopy, but i'm sure youre not looking for that, No need to worry about limits, the byte array will be resized automatically before Getting the data. Here's how you do:
Code:
Dim a() as byte
Open Target for Binary as 1
Open Source for Binary as 2
Put#1,,HeaderUDT ' or a set of variables
Get#2,len(HEaderUDT)+1,a
Put#1,,a
Erase a
Close 1,2
-
Got it
Okay, I got it work with a couple of changes. Thanks for your help :)
Needed to add ReDim A (sizeofdatatobereaded)