Copy#

Enumerations#

OmniClientCopyBehavior

Copy Behavior.

Functions#

OmniClientRequestId omniClientCopy(char const *srcUrl, char const *dstUrl, void *userData, OmniClientCopyCallback callback, OmniClientCopyBehavior behavior, const char *message)

Copy something from 'srcUrl' to 'dstUrl'.

OmniClientRequestId omniClientCopyFile(char const *srcUrl, char const *dstUrl, void *userData, OmniClientCopyCallback callback, OmniClientCopyBehavior behavior, const char *message)

Copy a file from 'srcUrl' to 'dstUrl'.

OmniClientRequestId omniClientCopyFolder(char const *srcUrl, char const *dstUrl, void *userData, OmniClientCopyCallback callback, OmniClientCopyBehavior behavior, const char *message)

Recursively copy a folder from 'srcUrl' to 'dstUrl'.

Typedefs#

Enumerations#

enum OmniClientCopyBehavior#

Copy Behavior.

Values:

enumerator eOmniClientCopy_ErrorIfExists#

Fails to copy with an error if the destination already exists.

enumerator eOmniClientCopy_Overwrite#

Overwrites any destination file(s) with the source file.

Functions#

OmniClientRequestId omniClientCopy(
char const *srcUrl,
char const *dstUrl,
void *userData,
OmniClientCopyCallback callback,
OmniClientCopyBehavior behavior,
const char *message,
)#

Copy something from ‘srcUrl’ to ‘dstUrl’.

This is equivalent to calling omniClientStat on ‘srcUrl’ then calling either omniClientCopyFile or omniClientCopyFolder 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 copy from

  • dstUrl – The destination URL to copy 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 copying

Returns:

A request ID that can be used with omniClientStop

OmniClientRequestId omniClientCopyFile(
char const *srcUrl,
char const *dstUrl,
void *userData,
OmniClientCopyCallback callback,
OmniClientCopyBehavior behavior,
const char *message,
)#

Copy 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 and behavior is eOmniClientCopy_Overwrite. Destination 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 copy from

  • dstUrl – The destination file URL to copy 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 copying

Returns:

A request ID that can be used with omniClientStop

OmniClientRequestId omniClientCopyFolder(
char const *srcUrl,
char const *dstUrl,
void *userData,
OmniClientCopyCallback callback,
OmniClientCopyBehavior behavior,
const char *message,
)#

Recursively copy 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 and behavior 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’.

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 copy from

  • dstUrl – The destination folder URL to copy 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 copying

Returns:

A request ID that can be used with omniClientStop

Typedefs#

typedef void (*OmniClientCopyCallback)(void *userData, OmniClientResult result)#

This is called with the result of omniClientCopy omniClientCopyFile and omniClientCopyFolder.