-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add VSICopyFileRestartable() to allow restart of upload of large files
Copy a source file into a target file in a way that can (potentially) be restarted. This function provides the possibility of efficiently restarting upload of large files to cloud storage that implements upload in a chunked way, such as /vsis3/ and /vsigs/. For other destination file systems, this function may fallback to VSICopyFile() and not provide any smart restartable implementation. Example of a potential workflow: ```cpp char* pszOutputPayload = NULL; int ret = VSICopyFileRestartable(pszSource, pszTarget, NULL, &pszOutputPayload, NULL, NULL, NULL); while( ret == 1 ) // add also a limiting counter to avoid potentiall endless looping { // TODO: wait for some time char* pszOutputPayloadNew = NULL; const char* pszInputPayload = pszOutputPayload; ret = VSICopyFileRestartable(pszSource, pszTarget, pszInputPayload, &pszOutputPayloadNew, NULL, NULL, NULL); VSIFree(pszOutputPayload); pszOutputPayload = pszOutputPayloadNew; } VSIFree(pszOutputPayload); ```
- Loading branch information
Showing
10 changed files
with
880 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.