gFileCopy: gFileCopy

Description Usage Arguments Details Value Author(s)

View source: R/gioFuncs.R

Description

Copies the file source to the location specified by destination. Can not handle recursive copies of directories.

Usage

1
2
gFileCopy(object, destination, flags = "G_FILE_COPY_NONE", cancellable = NULL, 
    progress.callback, progress.callback.data, .errwarn = TRUE)

Arguments

object

input GFile.

destination

destination GFile

flags

set of GFileCopyFlags

cancellable

optional GCancellable object, NULL to ignore.

progress.callback

function to callback with progress information

progress.callback.data

user data to pass to progress.callback

.errwarn

Whether to issue a warning on error or fail silently

Details

If the flag G_FILE_COPY_OVERWRITE is specified an already existing destination file is overwritten.

If the flag G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks will be copied as symlinks, otherwise the target of the source symlink will be copied.

If cancellable is not NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error G_IO_ERROR_CANCELLED will be returned.

If progress.callback is not NULL, then the operation can be monitored by setting this to a GFileProgressCallback function. progress.callback.data will be passed to this function. It is guaranteed that this callback will be called after all data has been transferred with the total number of bytes copied during the operation.

If the source file does not exist then the G_IO_ERROR_NOT_FOUND error is returned, independent on the status of the destination.

If G_FILE_COPY_OVERWRITE is not specified and the target exists, then the error G_IO_ERROR_EXISTS is returned.

If trying to overwrite a file over a directory the G_IO_ERROR_IS_DIRECTORY error is returned. If trying to overwrite a directory with a directory the G_IO_ERROR_WOULD_MERGE error is returned.

If the source is a directory and the target does not exist, or G_FILE_COPY_OVERWRITE is specified and the target is a file, then the G_IO_ERROR_WOULD_RECURSE error is returned.

If you are interested in copying the GFile object itself (not the on-disk file), see gFileDup.

Value

A list containing the following elements:

retval

[logical] TRUE on success, FALSE otherwise.

error

GError to set on error, or NULL

Author(s)

Derived by RGtkGen from GTK+ documentation


RGtk2 documentation built on Oct. 14, 2021, 5:08 p.m.

Related to gFileCopy in RGtk2...