BinaryFile_Read + BinaryFile_Save

Reads binary file in chunks, if not chuck defined, all file will be red/saved
Uses Get and Put
Reading binary files using Open for binary access with Get, has a limit of number of records of 2k only
Means cannot read beyond 2147 records, to go over it, increase the buffer of each record
Or, use gsplit application to split this file into small parts, GSplit can be automated in Command line

CodeFunctionName
What is this?

Public

Tested

Original Work
Function BinaryFile_Read(File2, Optional Bufferr = 0)
iFile = FreeFile()
Open File2 For Binary Access Read As #iFile
If Bufferr = 0 Then Bufferr = LOF(iFile)
BinaryFile_Read = String(Bufferr, " ")
Get #iFile, , BinaryFile_Read ' BinaryFile_Read = Input(LOF(iFile), #iFile)
Close #iFile
End Function
Sub BinaryFile_Save(File2, FileContent)
iFile = FreeFile()
Open File2 For Binary Access Write As #iFile
Put #iFile, , FileContent
Close #iFile
End Sub

File2, Optional Bufferr
Or
File2, FileContent

Views 4,440

Downloads 1,329

CodeID
DB ID

ANmarAmdeen
602
Revisions

v1.0

Monday
June
18
2018