Content-type: text/html
Manpage of GFAL_OPEN
GFAL_OPEN
Section: Library Functions (3)
Updated: 2003/11/19 12:56:29
Index
Return to Main Contents
NAME
gfal_open - open a file
SYNOPSIS
#include "gfal_api.h"
int gfal_open (const char *filename,
int flags,
mode_t mode);
Under Linux, for large files:
#define _LARGEFILE64_SOURCE
#include "gfal_api.h"
int gfal_open64 (const char *filename,
int flags,
mode_t mode);
For large files, under other systems:
#include "gfal_api.h"
int gfal_open64 (const char *filename,
int flags,
mode_t mode);
DESCRIPTION
gfal_open
opens a file according to the value of
flags.
- filename
-
specifies the file name: either a logical file name, a guid, an SURL or a TURL.
- flags
-
value is built by OR'ing the bits defined in
<fcntl.h>
but one and only one of the first three flags below must be used:
-
- O_RDONLY
-
open for reading only
- O_WRONLY
-
open for writing only
- O_RDWR
-
open for reading and writing
- O_CREAT
-
If the file exists already and
O_EXCL
is also set,
gfal_open
will fail.
- O_LARGEFILE
-
allows files whose sizes cannot be represented in 31 bits to be opened.
- mode
-
is used only if the file is created.
RETURN VALUE
This routine returns the file descriptor if the operation was successful or -1
if the operation failed. In the latter case,
errno
is set appropriately.
ERRORS
- ENOENT
-
The named file does not exist.
- EACCES
-
Search permission is denied on a component of the
filename
prefix or the file does not exist and write permission on the parent directory
is denied or the file exists and
flags
permission on the file itself is denied.
- EFAULT
-
filename
is a NULL pointer.
- EBUSY
-
Device or resource busy. Happens if you try to open in write mode a CASTOR file that is in an active migration stream.
- ENOTDIR
-
A component of
filename
prefix is not a directory.
- EINVAL
-
filename
has an invalid syntax.
- ECOMM
-
Communication error.
- EPROTONOSUPPORT
-
Access method not supported.
SEE ALSO
gfal(3)
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- RETURN VALUE
-
- ERRORS
-
- SEE ALSO
-
This document was created by
man2html,
using the manual pages.
Time: 12:34:06 GMT, January 20, 2004