'\" t
.\" Title: gfs_pio_open
.\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
.\" Generator: DocBook XSL Stylesheets vsnapshot
.\" Date: 8 Aug 2020
.\" Manual: Gfarm
.\" Source: Gfarm
.\" Language: English
.\"
.TH "GFS_PIO_OPEN" "3" "8 Aug 2020" "Gfarm" "Gfarm"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
gfs_pio_open \- open a file in the Gfarm file system
.SH "SYNOPSIS"
.sp
.ft B
.nf
#include
.fi
.ft
.HP \w'gfarm_error_t\ gfs_pio_open('u
.BI "gfarm_error_t\ gfs_pio_open(const\ char\ *\ " "gfarm_url" ", int\ " "flags" ", GFS_File\ *\ " "gfp" ");"
.SH "DESCRIPTION"
.PP
\fBgfs_pio_open()\fR
opens a file in the Gfarm file system specified by
\fIgfarm_url\fR, and returns a
\fIGFS_File\fR
structure to the address pointed by
\fIgfp\fR\&.
\fIgfarm_url\fR
is a path name in the Gfarm file system, or a Gfarm URL in the form of gfarm://metaserver:port/path/name\&.
.PP
Values of
\fIflags\fR
are constructed by a bitwise\-inclusive\-OR of the following list\&. Exactly one of the first three values should be specified:
.PP
\fBGFARM_FILE_RDONLY\fR
.RS 4
Open for reading only\&.
.RE
.PP
\fBGFARM_FILE_WRONLY\fR
.RS 4
Open for writing only\&.
.RE
.PP
\fBGFARM_FILE_RDWR\fR
.RS 4
Open for reading and writing\&.
.RE
.PP
\fBGFARM_FILE_TRUNC\fR
.RS 4
If the file already exist and is a regular file, it will be truncated to length 0 if the open mode allows writing\&.
.RE
.PP
\fBGFARM_FILE_APPEND\fR
.RS 4
The file is opened in append mode\&.
.RE
.PP
\fBGFARM_FILE_UNBUFFERED\fR
.RS 4
The file is accessed without buffering\&.
.RE
.SH "RETURN VALUES"
.PP
\fBGFARM_ERR_NO_ERROR\fR
.RS 4
The function terminated successfully\&.
.RE
.PP
\fBGFARM_ERR_IS_A_DIRECTORY\fR
.RS 4
\fIgfarm_url\fR
refers to a directory\&.
.RE
.PP
\fBGFARM_ERR_IS_A_SYMBOLIC_LINK\fR
.RS 4
\fIgfarm_url\fR
refers to a symbolic link\&.
.RE
.PP
\fBGFARM_ERR_OPERATION_NOT_PERMITTED\fR
.RS 4
\fIgfarm_url\fR
refers to not a regular file\&.
.RE
.PP
\fBGFARM_ERR_NO_SUCH_OBJECT\fR
.RS 4
A component used as a directory in
\fIgfarm_url\fR
does not exist\&.
.RE
.PP
\fBGFARM_ERR_NOT_A_DIRECTORY\fR
.RS 4
A component used as a directory in
\fIgfarm_url\fR
is not, in fact, a directory\&.
.RE
.PP
\fBGFARM_ERR_PERMISSION_DENIED\fR
.RS 4
The requested access to the file is not allowed, or one of the directories in
\fIgfarm_url\fR
did not allow search (execute) permission\&. Or, the authentication to the metadata server fails\&.
.RE
.PP
\fBGFARM_ERR_NO_MEMORY\fR
.RS 4
Insufficient memory was available\&.
.RE
.PP
\fBGFARM_ERR_INVALID_ARGUMENT\fR
.RS 4
\fIflags\fR
is not valid\&.
.RE
.PP
\fBGFARM_ERR_GFARM_URL_HOST_IS_MISSING\fR
.RS 4
\fIgfarm_url\fR
does not include a metadata server\&.
.RE
.PP
\fBGFARM_ERR_GFARM_URL_PORT_IS_MISSING\fR
.RS 4
\fIgfarm_url\fR
does not include a port number of the metadata server\&.
.RE
.PP
\fBGFARM_ERR_UNKNOWN_HOST\fR
.RS 4
The metadata server cannot be resolved\&.
.RE
.PP
\fBGFARM_ERR_TOO_MANY_OPEN_FILES\fR
.RS 4
The process opens too many files\&.
.RE
.PP
\fBGFARM_ERR_TOO_MANY_OPEN_FILES_IN_SYSTEM\fR
.RS 4
The system limit on the total number of open files has been reached\&.
.RE
.PP
\fBGFARM_ERR_NETWORK_IS_UNREACHABLE\fR
.RS 4
Network is unrechable\&.
.RE
.PP
\fBGFARM_ERR_OPERATION_TIMED_OUT\fR
.RS 4
Connetion timeout occurs\&.
.RE
.PP
\fBGFARM_ERR_PROTOCOL\fR
.RS 4
Protocol error occurs\&.
.RE
.PP
\fBGFARM_ERR_BROKEN_PIPE\fR
.RS 4
Connection to the metadata server is broken\&.
.RE
.PP
\fBGFARM_ERR_PROTOCOL_NOT_SUPPORTED\fR
.RS 4
Specified authentication protocol is not supported\&.
.RE
.PP
\fBGFARM_ERR_AUTHENTICATION\fR
.RS 4
User authentication failed when connecting to the metadata server\&.
.RE
.PP
Others
.RS 4
An error except the above occurred\&. The reason is shown by
\fBgfarm_error_string\fR(3)\&.
.RE
.SH "SEE ALSO"
.PP
\fBgfs_pio_close\fR(3),
\fBgfs_pio_create\fR(3),
\fBgfs_pio_eof\fR(3),
\fBgfs_pio_error\fR(3),
\fBgfs_pio_flush\fR(3),
\fBgfs_pio_getc\fR(3),
\fBgfs_pio_getline\fR(3),
\fBgfs_pio_open\fR(3),
\fBgfs_pio_putc\fR(3),
\fBgfs_pio_putline\fR(3),
\fBgfs_pio_puts\fR(3),
\fBgfs_pio_read\fR(3),
\fBgfs_pio_seek\fR(3),
\fBgfs_pio_ungetc\fR(3),
\fBgfs_pio_write\fR(3)