dosstat, dosfstat
Purpose
Gets the status of a DOS file.
Library
DOS Services Library (libdos.a)
Syntax
#include <dos.h>
int dosstat (path, buf) int dosfstat (dosfile, buf)
char *path; DOSFILE dosfile;
DOSSTAT *buf; DOSSTAT *buf;
Description
The dosstat subroutine gets the status of the file named
by the path parameter and stores that status into the
memory area pointed to by the buf parameter. Read,
write, and execute permissions are not required of the
named file, but all directories included in the path name
must be searchable.
The dosfstat subroutine gets the status of an open file
named by the dosfile parameter and stores that status
into the memory area pointed to by the buf parameter.
The DOSSTAT structure is defined in the dos.h file and
has the following form:
typedef struct
{
char st_drive_id, st_filetype;
long st_mode, st_ino, st_dev, st_rdev,
st_nlink, st_uid, st_gid, st_size;
time_t st_atime, st_mtime, st_ctime;
} DOSSTAT;
The st_drive_id field is set to the logical drive on
which the file exists. The st_filetype field is set to
the following values:
"u" For an AIX file.
"d" For a DOS file.
"t" For a tty file.
"o" For any other type of file.
For non-DOS files, all other fields are identical to the
fields defined in "stat.h." For DOS files, the fields
have the following meanings:
st_mode If the M_DIRECTORY bit is set, the file is a
directory. All other bits correspond to the
mode bits as defined in the doscreate subrou-
tine.
st_ino The number of the first cluster in the file.
st_rdev Contains the attribute byte from the DOS
directory entry.
st_size The size in bytes of the file as set in the
DOS directory entry.
st_mtime The time, in AIX format, the file was last
modified. (For information about this
format, see "time" and "ctime, localtime,
gmtime, asctime, tzset.")
st_dev Meaningless for DOS files.
st_nlink Meaningless for DOS files.
st_uid Meaningless for DOS files.
st_gid Meaningless for DOS files.
st_atime Meaningless for DOS files.
st_ctime Meaningless for DOS files.
Return Value
Upon successful completion, a value of 0 is returned. If
the dosstat or dosfstat subroutines fail, a value of -1
is returned and doserrno is set to indicate the error.
Related Information
In this book: "DOS services library," "dosustat," and
"stat, fstat."