#include <gfarm/gfarm.h>
gfarm_error_t gfs_pio_create( |
gfarm_url, | |
| flags, | ||
| mode, | ||
gfp); |
const char * gfarm_url;int flags;gfarm_mode_t mode;GFS_File * gfp;gfs_pio_create() creates a new file in the
Gfarm file system whose name is the
string pointed to by gfarm_url with the access mode mode,
and returns a GFS_File structure to the address pointed to by
gfp. Mode specifies the file permissions to be created,
and is modified by the process's umask.
The
flags
argument has the same meaning as the second argument of
gfs_pio_open(), including the point
such that exactly one of
GFARM_FILE_RDONLY,
GFARM_FILE_WRONLY, and
GFARM_FILE_RDWR
should be specified.
In addition, it is possible to specify
GFARM_FILE_EXCLUSIVE.
With this flag,
gfs_pio_create()
will fail when the file already exists.
Note that
GFARM_FILE_TRUNC
must be explicitly specified by the
flags
argument if needed.
GFARM_ERR_NO_ERRORThe function terminated successfully.
GFARM_ERR_IS_A_DIRECTORYgfarm_url refers to a directory.
GFARM_ERR_IS_A_SYMBOLIC_LINKgfarm_url refers to a symbolic link.
GFARM_ERR_OPERATION_NOT_PERMITTEDgfarm_url refers to not a regular file.
GFARM_ERR_NOT_A_DIRECTORYA component used as a directory in gfarm_url is not, in fact, a
directory.
GFARM_ERR_PERMISSION_DENIEDThe requested access to the file is not allowed, or one of the
directories in gfarm_url did not allow search (execute)
permission, or the file did not exist yet and write access to the
parent directory is not allowed.
Or, the authentication to the metadata server fails.
GFARM_ERR_NO_MEMORYInsufficient memory was available.
GFARM_ERR_INVALID_ARGUMENTflags
is not valid.
GFARM_ERR_GFARM_URL_HOST_IS_MISSINGgfarm_url
does not include a metadata server.
GFARM_ERR_GFARM_URL_PORT_IS_MISSINGgfarm_url
does not include a port number of the metadata server.
GFARM_ERR_UNKNOWN_HOSTThe metadata server cannot be resolved.
GFARM_ERR_TOO_MANY_OPEN_FILESThe process opens too many files.
GFARM_ERR_TOO_MANY_OPEN_FILES_IN_SYSTEMThe system limit on the total number of open files has been reached.
GFARM_ERR_NETWORK_IS_UNREACHABLENetwork is unrechable.
GFARM_ERR_OPERATION_TIMED_OUTConnetion timeout occurs.
GFARM_ERR_PROTOCOLProtocol error occurs.
GFARM_ERR_BROKEN_PIPEConnection to the metadata server is broken.
GFARM_ERR_PROTOCOL_NOT_SUPPORTEDSpecified authentication protocol is not supported.
GFARM_ERR_AUTHENTICATIONUser authentication failed when connecting to the metadata server.
GFARM_ERR_ALREADY_EXISTSgfarm_url already exists and GFARM_FILE_EXCLUSIVE was used.
An error except the above occurred. The reason is shown by gfarm_error_string(3).