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 :: ios
character(len=256) :: message
integer :: lun
do
write(*,(a),advance=no)enter filename>
read(*,(a),iostat=ios)filename
if(ios /= 0)exit
write(*,(a),advance=no)enter mode ([rwa][bt][+]>
read(*,(a),iostat=ios)mode
if(ios /= 0)exit
lun=fileopen(filename,mode,ios)
if(ios == 0)then
write(*,*)OPENED
else
write(*,*)ERROR: IOS=,ios
endif
if(lun /= -1)then
call print_inquire(lun,)
close(lun,iostat=ios,iomsg=message)
if(ios /= 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) | June 29, 2025 |
Generated by manServer 1.08 from 47f392e6-9b70-4239-981a-588d472e9d3f using man macros.