C Library Functions - print_inquire (3)
NAME
print_inquire(3f) - [M_io:QUERY] Do INQUIRE on file by name/number and
print results
(LICENSE:PD)
CONTENTS
Synopsis
Description
Options
Examples
Author
License
SYNOPSIS
Definition:
subroutine print_inquire(lun)
or
subroutine print_inquire(name)
integer,intent(in),optional :: lun
character(len=*),intent(in),optional :: name
DESCRIPTION
Given either a Fortran file-unit-number or filename, call the
INQUIRE(3f) intrinsic and print typical status information.
OPTIONS
|
lun |
if lun is not equal to -1 then query by number and ignore
filename even if present
|
|
name |
if lun = -1 or is not present then query by this filename
|
|
EXAMPLES
Sample program:
program demo_print_inquire
use M_io, only : print_inquire, fileopen
implicit none
character(len=4096) :: filename
character(len=20) :: mode
integer :: iostat
character(len=256) :: message
integer :: lun
do
write(*,(a),advance=no)enter filename>
read(*,(a),iostat=iostat)filename
if(iostat /= 0)exit
write(*,(a),advance=no)enter mode ([rwa][bt][+]>
read(*,(a),iostat=iostat)mode
if(iostat /= 0)exit
lun=fileopen(filename,mode,iostat)
if(iostat == 0)then
write(*,*)OPENED
else
write(*,*)ERROR: iostat=,iostat
endif
if(lun /= -1)then
call print_inquire(lun,)
close(lun,iostat=iostat,iomsg=message)
if(iostat /= 0)then
write(*,(a))trim(message)
endif
endif
enddo
end program demo_print_inquire
AUTHOR
John S. Urban
LICENSE
Public Domain
| Nemo Release 3.1 | print_inquire (3) | August 28, 2026 |
Generated by manServer 1.08 from b2fc72a7-404c-4f03-8ae3-69946388e54a using man macros.