JoinFileBlocks Method

Joins multiple files' blocks together into one file.

Syntax

int JoinFileBlocks(const QString& qsTargetFilePath, const QString& qsSourceFilePaths);

Remarks

This method joins the blocks from the files at one or more SourceFilePaths onto the end of the file at TargetFilePath. (If this operations is successful, the original source files will no longer be accessible.)

The order of the source files' paths in SourceFilePaths determines the order in which their blocks are joined onto the file at TargetFilePath.

Usage Constraints

The server imposes a number of constraints that must be satisfied in order for the join operation to complete successfully.

TargetFilePath and SourceFilePaths must both be non-empty.

SourceFilePaths must be specified as a comma-separated list of source file paths, with no duplicates or paths that match TargetFilePath.

Additionally, all files referred to by both TargetFilePath and SourceFilePaths must satisfy the following constraints:

  • All files must already exist.
  • All files must be located in the exact same directory (i.e., all files must be siblings).
  • The block size of all source files must be less than or equal to the block size of the target file.

If any of the above constraints are not satisfied, the server will return an error.

The class will take care of verifying that all parameters are non-empty and that all paths begin with a forward slash (/).

Error Handling

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Cloud 2020 Qt Edition - Version 20.0 [Build 8265]