Move
Functions
- OmniClientRequestId omniClientMove(char const *srcUrl, char const *dstUrl, void *userData, OmniClientMoveCallback callback, OmniClientCopyBehavior behavior, const char *message)
Move something from 'srcUrl' to 'dstUrl'.
- OmniClientRequestId omniClientMoveFile(char const *srcUrl, char const *dstUrl, void *userData, OmniClientMoveCallback callback, OmniClientCopyBehavior behavior, const char *message)
Move a file from 'srcUrl' to 'dstUrl'.
- OmniClientRequestId omniClientMoveFolder(char const *srcUrl, char const *dstUrl, void *userData, OmniClientMoveCallback callback, OmniClientCopyBehavior behavior, const char *message)
Recursively move a folder from 'srcUrl' to 'dstUrl'.
Typedefs
- OmniClientMoveCallback
This is called with the result of omniClientMove .
Functions
-
OmniClientRequestId omniClientMove(char const *srcUrl, char const *dstUrl, void *userData, OmniClientMoveCallback callback, OmniClientCopyBehavior behavior, const char *message)
Move something from ‘srcUrl’ to ‘dstUrl’.
This is equivalent to calling omniClientStat on ‘srcUrl’ then calling either omniClientMoveFile or omniClientMoveFolder depending on if it’s a file or a folder.
Note
If this function is called after omniClientShutdown, kInvalidRequestId will be returned, and the callback will not be called.
-
OmniClientRequestId omniClientMoveFile(char const *srcUrl, char const *dstUrl, void *userData, OmniClientMoveCallback callback, OmniClientCopyBehavior behavior, const char *message)
Move a file from ‘srcUrl’ to ‘dstUrl’.
This fails with eOmniClientResult_ErrorWrongType if the item at ‘srcUrl’ is not a file. This fails with eOmniClientResult_ErrorNotFound if the item at ‘srcUrl’ doesn’t exist. This fails with eOmniClientResult_ErrorAlreadyExists if the item at ‘dstUrl’ already exists and
behavior
is eOmniClientCopy_ErrorIfExists. This fails with eOmniClientResult_ErrorWrongType if the item at ‘dstUrl’ already exists but is not a file andbehavior
is eOmniClientCopy_Overwrite.If both src and dst are on the same server, this is done on the server.
Otherwise, it is first copied from srcUrl to dstUrl, then deleted from srcUrl. Note it is possible for the copy to succeed and the delete to fail. In this case the result will be the error code from the delete but ‘copied’ will be true.
If the result is ‘Ok’ but ‘copied’ is false, that means the move was done entirely on the server, so no local copy had to be made.
Destination (parent) folders will be created as needed.
The message parameter is applied to the checkpoint created at dstUrl after the copy is complete.
Note
If this function is called after omniClientShutdown, kInvalidRequestId will be returned, and the callback will not be called.
-
OmniClientRequestId omniClientMoveFolder(char const *srcUrl, char const *dstUrl, void *userData, OmniClientMoveCallback callback, OmniClientCopyBehavior behavior, const char *message)
Recursively move a folder from ‘srcUrl’ to ‘dstUrl’.
This fails with eOmniClientResult_ErrorWrongType if the item at ‘srcUrl’ is not a folder. This fails with eOmniClientResult_ErrorNotFound if the item at ‘srcUrl’ doesn’t exist. This fails with eOmniClientResult_ErrorAlreadyExists if the item at ‘dstUrl’ already exists and
behavior
is eOmniClientCopy_ErrorIfExists. This fails with eOmniClientResult_ErrorWrongType if the item at ‘dstUrl’ already exists but is not a folder andbehavior
is eOmniClientCopy_Overwrite.Setting
behavior
to eOmniClientCopy_Overwrite will overwrite each individual file inside the folder, but will not remove files that exist in ‘dstUrl’ but not in ‘srcUrl’.If both src and dst are on the same server, this is done on the server.
Otherwise, it is first copied from srcUrl to dstUrl, then deleted from srcUrl. Note it is possible for the copy to succeed and the delete to fail. In this case the result will be the error code from the delete but ‘copied’ will be true.
If the result is ‘Ok’ but ‘copied’ is false, that means the move was done entirely on the server, so no local copy had to be made.
Destination folders will be created as needed.
Trailing slashes are ignored!
The message parameter is applied to the checkpoints created for each individual file that is copied.
Note
If this function is called after omniClientShutdown, kInvalidRequestId will be returned, and the callback will not be called.
Typedefs
-
typedef void (*OmniClientMoveCallback)(void *userData, OmniClientResult result, bool copied)
This is called with the result of omniClientMove.