gfal_open_python(3) - Linux man page
Name
gfal_open - open a fileSynopsis
import osimport gfal
int gfal_open (string filename, int flags, int mode);
int gfal_open64 (string filename, int flags, int mode);
Description
- 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 following constants:
- os.O_RDONLY
- open for reading only
- os.O_WRONLY
- open for writing only
- os.O_RDWR
- open for reading and writing
- os.O_CREAT
- creation of the file if needed ; if the file exists already and os.O_EXCL is also set, gfal_open will fail.
- os.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.