29.01.2013 Views

GPFS: Administration and Programming Reference - IRA Home

GPFS: Administration and Programming Reference - IRA Home

GPFS: Administration and Programming Reference - IRA Home

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

gpfs_iopen() Subroutine<br />

Name<br />

gpfs_iopen() - Opens a file or directory by inode number.<br />

Library<br />

<strong>GPFS</strong> Library (libgpfs.a for AIX, libgpfs.so for Linux)<br />

Synopsis<br />

#include <br />

gpfs_ifile_t *gpfs_iopen(gpfs_fssnap_h<strong>and</strong>le_t *fssnapH<strong>and</strong>le,<br />

gpfs_ino_t ino,<br />

int open_flags,<br />

const gpfs_iattr_t *statxbuf,<br />

const char *symlink);<br />

Description<br />

The gpfs_iopen() subroutine opens a user file or directory for backup. The file is identified by its inode<br />

number ino within the file system or snapshot identified by the fssnapH<strong>and</strong>le. The fssnapH<strong>and</strong>le<br />

parameter must be the same one that was used to create the inode scan that returned the inode number<br />

ino.<br />

To read the file or directory, the open_flags must be set to <strong>GPFS</strong>_O_BACKUP. The statxbuf <strong>and</strong><br />

symlink parameters are reserved for future use <strong>and</strong> must be set to NULL.<br />

For an overview of using gpfs_iopen() in a backup application, see “Using APIs to develop backup<br />

applications” on page 24.<br />

Notes:<br />

1. Compile any program that uses this subroutine with the -lgpfs flag from the following library:<br />

v libgpfs.a for AIX<br />

v libgpfs.so for Linux<br />

Parameters<br />

fssnapH<strong>and</strong>le File system snapshot h<strong>and</strong>le.<br />

ino inode number.<br />

open_flags<br />

<strong>GPFS</strong>_O_BACKUP Read files for backup.<br />

O_RDONLY For gpfs_iread().<br />

statxbuf This parameter is reserved for future use <strong>and</strong> should always be set to NULL.<br />

symlink This parameter is reserved for future use <strong>and</strong> should always be set to NULL.<br />

Exit status<br />

If the gpfs_iopen() subroutine is successful, it returns a pointer to the inode’s file h<strong>and</strong>le.<br />

If the gpfs_iopen() subroutine is unsuccessful, it returns NULL <strong>and</strong> the global error variable errno is set to<br />

indicate the nature of the error.<br />

Chapter 9. <strong>GPFS</strong> programming interfaces 317

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!