(DataFlex) Reassemble a Previously Split File
Demonstrates how to reassemble a previously split file.
Use ChilkatAx-win32.pkg
Procedure Test
Handle hoFac
Boolean iSuccess
String sReassembledFilename
String sPartPrefix
String sPartExtension
String sSrcDirPath
String sTemp1
Get Create (RefClass(cComCkFileAccess)) To hoFac
If (Not(IsComObjectCreated(hoFac))) Begin
Send CreateComObject of hoFac
End
// Any type of file may be reassembled. It doesn't matter if it's
// a binary file or a text file.
Move "hamlet2.xml" To sReassembledFilename
Move "hamlet" To sPartPrefix
Move "spl" To sPartExtension
Move "." To sSrcDirPath
// Reassembles the original file from hamlet1.spl, hamlet2.spl, ...
Get ComReassembleFile Of hoFac sSrcDirPath sPartPrefix sPartExtension sReassembledFilename To iSuccess
If (iSuccess = True) Begin
Showln "Success."
End
Else Begin
Get ComLastErrorText Of hoFac To sTemp1
Showln sTemp1
End
End_Procedure
|