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.
- Parameters:
srcUrl – The source URL to move from
dstUrl – The destination URL to move to
userData – User data passed to the callback
callback – The callback function to register
behavior – Controls what happens if the destination already exists
message – Optional message to apply to the checkpoint created after moving
- Returns:
A request ID that can be used with omniClientStop
- 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
behavioris eOmniClientCopy_ErrorIfExists. This fails with eOmniClientResult_ErrorWrongType if the item at ‘dstUrl’ already exists but is not a file andbehavioris 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.
- Parameters:
srcUrl – The source file URL to move from
dstUrl – The destination file URL to move to
userData – User data passed to the callback
callback – The callback function to register
behavior – Controls what happens if the destination already exists
message – Optional message to apply to the checkpoint created after moving
- Returns:
A request ID that can be used with omniClientStop
- 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
behavioris eOmniClientCopy_ErrorIfExists. This fails with eOmniClientResult_ErrorWrongType if the item at ‘dstUrl’ already exists but is not a folder andbehavioris eOmniClientCopy_Overwrite.Setting
behaviorto 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.
- Parameters:
srcUrl – The source folder URL to move from
dstUrl – The destination folder URL to move to
userData – User data passed to the callback
callback – The callback function to register
behavior – Controls what happens if the destination already exists
message – Optional message to apply to the checkpoints created after moving
- Returns:
A request ID that can be used with omniClientStop
Typedefs#
-
typedef void (*OmniClientMoveCallback)(void *userData, OmniClientResult result, bool copied)#
This is called with the result of omniClientMove.