.\" @(#)stat.3f 1.4 86/01/02 SMI; from UCB 4.2 .TH STAT 3F "15 September 1998" .SH NAME stat, lstat, fstat \- get file status .SH SYNOPSIS .\" .IX stat "" \fLstat\fP .IX lstat "" \fLlstat\fP .IX fstat "" \fLfstat\fP .IX file status .IX status "of file" .\" .B integer function stat(name,statb) .br .B character*(*) name .br .B integer statb(13) .sp 1 .B integer function lstat(name,statb) .br .B character*(*) name .br .B integer statb(13) .sp 1 .B integer function fstat(lunit,statb) .br .B integer statb(13) .\" .SH DESCRIPTION These routines return detailed information about a file. .PP The functions .B stat and .B lstat do the query by .IR filename . .PP The function .B fstat does the query by FORTRAN logical unit .IR lunit . .PP The value of each function is zero if successful, and an error code otherwise. .PP The variable .I statb receives the status structure for the file. .sp 1 Calling Sequences: .sp 1 .IR stat : .br .B integer stat, statb(13) .br .B character name*(*) .br .B "ierr = stat ( name, statb )" .sp 1 .IR fstat : .br .B integer fstat, logunit, statb(13) .br .B "ierr = fstat ( logunit, statb )" .sp .IR lstat : .br .B integer lstat, statb(13) .br .B character name*(*) .br .B "ierr = lstat ( name, statb )" .sp .\".in -8 The meaning of the information returned in the array .B statb is as described for the structure .B stat under .BR stat (2). .PP Spare values are not included. The order is: .sp .nf .ta 1i 1.7i 2.5i \f3statb\f1(1) device inode resides on \f3statb\f1(2) this inode's number \f3statb\f1(3) protection \f3statb\f1(4) number of hard links to the file \f3statb\f1(5) user id of owner \f3statb\f1(6) group id of owner \f3statb\f1(7) the device type, for inode that is device \f3statb\f1(8) total size of file \f3statb\f1(9) file last access time \f3statb\f1(10) file last modify time \f3statb\f1(11) file last status change time \f3statb\f1(12) optimal blocksize for file system i/o ops \f3statb\f1(13) actual number of blocks allocated .fi .SH NOTES These routines do not return an error or warning when used on files larger than 2 Gbytes ("large" files, where the size in bytes is beyond the ranger of INTEGER*4 data). However, the value returned as the total size of the file (statb(8)) will be truncated to the lower 32 bits. Support for large files was introduced with the release of the Solaris 2.6 operating environment. Use .BR stat64 (3F), .BR lstat64 (3F), and .BR fstat64 (3F), the 64-bit versions of these routines, with large files. .SH FILES .B libF77.a .SH "SEE ALSO" .BR stat (2), .BR access (3F), .BR perror (3F), .BR time (3F) .br .BR stat64 (3F), .BR lstat64 (3F), .BR fstat64 (3F) .SH BUGS Path names cannot be longer than .B MAXPATHLEN as defined in .BR .