Scroll to navigation

RFIO_FSEEK(3) Rfio Library Functions RFIO_FSEEK(3)

NAME

rfio_fseek - positions/repositions a file

SYNOPSIS

#include <sys/types.h>
#include "rfio_api.h"

int rfio_fseek (FILE *fp, long offset, int whence);

Under Linux, for large files:
#define _LARGEFILE64_SOURCE
#include <sys/types.h>
#include "rfio_api.h"

int rfio_fseeko64 (FILE *fp, off64_t offset, int whence);

For large files, under other systems:
#include <sys/types.h>
#include "rfio_api.h"

int rfio_fseeko64 (FILE *fp, off64_t offset, int whence);

DESCRIPTION

rfio_fseek positions/repositions to offset the file associated with the descriptor fp generated by a previous rfio_fopen. whence indicates how to interpret the offset value:

The offset is set from beginning of file.
The offset is added to current position.
The offset is added to current file size.
rfio_fseeko64 can be used with large files and allows to use a 64 bit offset rather than a long.

RETURN VALUE

This routine returns 0 if the operation was successful or -1 if the operation failed. In the latter case, serrno is set appropriately.

ERRORS

fp is not a valid descriptor.
incorrect value for whence.
Host unknown.
Service unknown.
Timed out.
Version ID mismatch.
Internal error.
Connection closed by remote end.
Communication error.

SEE ALSO

rfio_fopen(3)

AUTHOR

LCG Grid Deployment Team

$Date: 2005/03/31 13:13:02 $ LCG