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
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
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
Or
File2, FileContent
Views 4,448
Downloads 1,335
CodeID
DB ID