gpfs_clone_copy() subroutine

Creates a file clone of a read-only clone parent file.

Library

GPFS Library (libgpfs.a for AIX®, libgpfs.so for Linux®)

Synopsis

#include <gpfs.h>
int gpfs_clone_copy(const char *sourcePathP, const char *destPathP);

Description

The gpfs_clone_copy() subroutine creates a writeable file clone from a read-only clone parent file.

Parameters

sourcePathP
The path of a read-only source file to clone. The source file can be a file in a snapshot or a clone parent file created with the gpfs_clone_snap() subroutine.
destPathP
The path of the destination file to create. The destination file will become the file clone.

Exit status

If the gpfs_clone_copy() subroutine is successful, it returns a value of 0 and creates a file clone from the clone parent.

If the gpfs_clone_copy() subroutine is unsuccessful, it returns a value of -1 and sets the global error variable errno to indicate the nature of the error.

Exceptions

None.

Error status

Error codes include but are not limited to the following:

EACCESS
Permission denied when writing to the destination path or reading from the source path.
EEXIST
The destination file already exists.
EFAULT
The input argument points outside the accessible address space.
EINVAL
The source or destination does not refer to a regular file or a GPFS file system.
EISDIR
The specified destination file is a directory.
ENAMETOOLONG
The source or destination path name is too long.
ENOENT
The source file does not exist.
ENOSPC
The file system has run out of disk space.
ENOSYS
The gpfs_clone_copy() subroutine is not available.
EPERM
The source file is a directory or is not a regular file.
EXDEV
The source file and destination file are not in the same file system.

Location

/usr/lpp/mmfs/lib/libgpfs.a for AIX

/usr/lpp/mmfs/lib/libgpfs.so for Linux