NAME
dbfilename - compose filename from database record
SYNOPSIS
#include "db.h" ;
int dbfilename(Dbptr db, char *filename)
DESCRIPTION
Given a database pointer specifying a row in a table,
dbfilename
gets the dir and dfile from the row, and composes the
file name by concatenating the directory of
the database table, dir, and dfile. It also checks to
see if the file exists, which it indicates by the return code.
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