qc.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
fstat, stat
 Summary Example                         Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
     The fstat and stat functions obtain information about an open file
     and store the information in the structure pointed to by <buffer>.
     The fstat function specifies the file with a file handle, and the
     stat function specifies the file or directory with a path.
 
     The structure, whose type stat is defined in SYS\STAT.H,
     contains the following fields:
 
     Field        Value
 
     st_atime     Time of last modification of file (same as st_mtime
                  and st_ctime).
 
     st_ctime     Time of last modification of file (same as st_atime
                  and st_mtime).
 
     st_dev       Either the drive number of the disk containing the
                  file, or <handle> in the case of a device (same as
                  st_rdev).
 
     st_mode      Bit mask for file-mode information. The S_IFCHR bit
                  is set if <handle> refers to a device, and the
                  S_IFREG bit is set if <handle> refers to an ordinary
                  file. User read/write bits are set according to the
                  file's permission mode. (S_IFCHR and other constants
                  are defined in SYS\STAT.H)
 
     st_mtime     Time of last modification of file (same as st_atime
                  and st_ctime).
 
     st_nlink     Always 1.
 
     st_rdev      Either the drive number of the disk containing the
                  file, or <handle> in the case of a device (same as
                  st_dev).
 
     st_size      Size of the file in bytes.
 
     In OS/2, st_dev does not contain meaningful information. In fact,
     it is set to 0. OS/2 provides no way to recover the host drive
     from the open file handle.
 
     Note that if <handle> refers to a device, the size and time fields
     in the stat structure are not meaningful.
 
     Return Value
 
     The fstat or stat functions return the value 0 if the file-status
     information is obtained. A return value of -1 indicates an error.
     In the case of error, fstat sets errno to EBADF, indicating an
     invalid file handle. In the case of an error with stat, errno is
     set to ENOENT, indicating that the file name or path name cannot
     be found.
                                    -♦-