PureBasic
PureBasic
Reassemble a Previously Split File
Demonstrates how to reassemble a previously split file.Chilkat PureBasic Downloads
IncludeFile "CkFileAccess.pb"
Procedure ChilkatExample()
success.i = 0
fac.i = CkFileAccess::ckCreate()
If fac.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
; Any type of file may be reassembled. It doesn't matter if it's
; a binary file or a text file.
reassembledFilename.s = "hamlet2.xml"
partPrefix.s = "hamlet"
partExtension.s = "spl"
srcDirPath.s = "."
; Reassembles the original file from hamlet1.spl, hamlet2.spl, ...
success = CkFileAccess::ckReassembleFile(fac,srcDirPath,partPrefix,partExtension,reassembledFilename)
If success = 1
Debug "Success."
Else
Debug CkFileAccess::ckLastErrorText(fac)
EndIf
CkFileAccess::ckDispose(fac)
ProcedureReturn
EndProcedure