NAME
dbextfile - compose filename from database record
SYNOPSIS
#include "db.h"
int dbextfile(Dbptr db, char *tablename, char *filename)
DESCRIPTION
Given a database pointer specifying a row in a table, and (optionally) the
base table name,
dbextfile
gets the dir and dfile from the row, and composes the
external file name by concatenating the directory of
the database table, dir, and dfile. The complete path
is returned in the user supplied string
filename. The
existence of the file is indicated by the return code.
The table name is required only for views which contain multiple
tables with external files. Such views specify multiple
external files; if no table is specified, the first dir/dfile
combination from the record is used.
RETURN VALUES
Return codes are:
-
1
file exists and is readable
-
2
compressed file exists and is readable
-
0
file does not exist, but directory is writable
-
-1
file does not exist, and directory is not writable.
If the file exists, its actual name is returned -- i.e., if
the file is compressed, the return filename includes the .Z or .gz
suffix.
LIBRARY
$(DBLIBS)
SEE ALSO
dbintro(3)
AUTHOR
Daniel Quinlan