SCBD_OPEN_FILE(3)
SCOREBOARD LIBRARY (C)
SCBD_OPEN_FILE(3)
NAME
scbd_open_file - open a file whose name is specified in scoreboard database

SYNOPSIS
#include <scboard.h>

int scbd_open_file( char *name, char *attr, int *fd );

DESCRIPTION
scbd_open_file() attempts to open a file which was originally located on the host where the scoreboard process is running. Its filename is the value of a record having the name specified in the name argument and the attribute specified in the attr argument. If there are two or more values in the record, only the first value is assumed to be the filename. scbd_open_file() copies the file onto local disk (/var/tmp/score) as a cache when this is the first access to the file, then opens the cache file and returns its file descriptor in the fd argument. If the original file is modified, then the cache file will be copied again. The necessary information to validate the cache file is encoded in the cache filename. Since the cache file creation date and time are obtained using the stat(2) Unix system call, clocks of the scoreboard server host and local host must be synchronized.

RETURN VALUES
scbd_open_file() returns 0 on success or one of the the following errors:

ERRORS
Error code is the same as the open(2) Unix system call.

ENVIRONMENT
SCBDSERV
Hostname (and port number) of the scoreboard(8) database process

SEE ALSO
scoreboard(8), scorehosts.db(5)

CREDIT
This document is a part of the SCore cluster system software developed at PC Cluster Consortium, Japan. Copyright (C) 2003 PC Cluster Consortium.