ClearRange Method

Clears a range of bytes from a file.

Syntax

int ClearRange(const QString& qsFilePath, qint64 lFirst, qint64 lLast);

Remarks

This method clears the range of bytes from First to Last (inclusive) from the file at FilePath in the share currently selected by Share.

The server tracks ranges of file data in 512-byte chunks, aligned to the absolute beginning of the file. When this method is called, the server frees any such chunks that are completely covered by the specified range of bytes ([First]-[Last]), and writes 0s to the appropriate portions of any chunks which are not completely covered by that range.

Freed chunks are not included in the results returned by GetRanges.

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]