Man Linux: Main Page and Category List

NAME

       gfs_pio_open - open a Gfarm file

SYNOPSIS

       #include <gfarm/gfarm.h>

       char *gfs_pio_open (char * gfarm_url, int flags, GFS_File * gfp);

DESCRIPTION

       gfs_pio_open()  opens the Gfarm file whose name is the string specified
       by gfarm_url, and returns a GFS_File structure to the  address  pointed
       by  gfp.   Values of flags are constructed by a bitwise-inclusive-OR of
       the following list.  Exactly one of the first three  values  should  be
       specified:

       GFARM_FILE_RDONLY
              Open for reading only.

       GFARM_FILE_WRONLY
              Open for writing only.

       GFARM_FILE_RDWR
              Open for reading and writing.

       GFARM_FILE_TRUNC
              If  the  file  already  exist  and is a regular file, it will be
              truncated to length 0 if the open mode allows writing.

       GFARM_FILE_APPEND
              The file is opened in append mode.

       The following may be specified as a hint for efficient execution:

       GFARM_FILE_SEQUENTIAL
              File will be accessed sequentially.

       GFARM_FILE_REPLICATION
              File may be replicated to  a  local  filesystem  when  accessing
              remotely.

       GFARM_FILE_NOT_REPLICATION
              File  may not be replicated to a local filesystem when accessing
              remotely.

       GFARM_FILE_NOT_RETRY
              When the selected file replica  does  not  exist  or  cannot  be
              accessed by some reason, open will fail without trying to access
              another file replica.

       GFARM_FILE_REPLICATION   and   GFARM_FILE_NOT_REPLICATION   cannot   be
       specified at the same time.

       When  gfs_pio_open() is used by parallel processes executed by gfrun(3)
       or gfmpirun_p4(3), the returned GFS_File structure of each process  has
       individual file pointers among parallel processes.

RETURN VALUES

       NULL   The function terminated successfully.

       GFARM_ERR_NO_MEMORY
              Insufficient memory was available.

       GFARM_ERR_AUTHENTICATION
              User   authentication  failed  when  connecting  to  gfmd(8)  or
              gfsd(8).

       GFARM_ERR_PERMISSION_DENIED
              The requested access to the file is not allowed, or one  of  the
              directories   in   gfarm_url  did  not  allow  search  (execute)
              permission.

       GFARM_ERR_IS_A_DIRECTORY
              gfarm_url refers to a directory.

       GFARM_ERR_NO_SUCH_OBJECT
              A component used as a directory in gfarm_url does not exist.

       GFARM_ERR_NOT_A_DIRECTORY
              A component used as a directory in gfarm_url is not, in fact,  a
              directory.

       Others An  error except the above occurred.  The reason is shown by its
              pointed strings.

SEE ALSO

       gfs_pio_close(3), gfs_pio_create(3), gfs_pio_eof(3),  gfs_pio_error(3),
       gfs_pio_flush(3), gfs_pio_getc(3), gfs_pio_getline(3), gfs_pio_open(3),
       gfs_pio_putc(3), gfs_pio_putline(3), gfs_pio_puts(3),  gfs_pio_read(3),
       gfs_pio_seek(3),  gfs_pio_set_view_index(3), gfs_pio_set_view_local(3),
       gfs_pio_ungetc(3), gfs_pio_write(3)