LSTAT

Portability Function: Returns detailed information about a file.

Module: USE IFPORT

Syntax

result = LSTAT (name, statb)

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


statb
(Output) INTEGER(4) or INTEGER(8). One-dimensional array of size 12; where the system information is stored. See STAT for the possible values returned in statb.

Results

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

LSTAT returns detailed information about the file named in name.

On Linux* and Mac OS* systems, if the file denoted by name is a link, LSTAT provides information on the link, while STAT provides information on the file at the destination of the link.

On Windows* systems, LSTAT returns exactly the same information as STAT (because there are no symbolic links on these systems). 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, Building Applications: Portability Library Overview

Example

USE IFPORT
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