LSTAT

Portability Function: Returns detailed information about a file.

Module: USE DFPORT

Syntax

result = LSTAT (name, statb)

name
(Input) Character*(*). Name of the file to examine.


statb
(Output) INTEGER(4). One-dimensional array with a size of 12. See STAT for the possible values returned in statb.

Results:

The result is of type INTEGER(4). The result is zero if successful; otherwise, an error code (see IERRNO).

LSTAT returns detailed information about the file named in name. In this implementation, LSTAT returns exactly the same information as STAT (because there are no symbolic links). STAT is the preferred function.

INQUIRE also provides information about file properties.

Compatibility

CONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIB

See Also: INQUIRE, GETFILEINFOQQ, STAT, FSTAT, Portability Library

Example

USE DFPORT
INTEGER(4) info_array(12), istatus
character*20 file_name
print *, "Enter name of file to examime: "
read *, file_name
ISTATUS = LSTAT (file_name, info_array)
if (.NOT. ISTATUS) then
   print *, info_array
else
   print *, 'Error ',istatus
end if