Download Fortran Library Reference
Transcript
See also: execve(2) and environ(5). getfd: Get File Descriptor for External Unit Number The function is called by: INTEGER*4 getfd fildes = getfd( unitn ) unitn INTEGER*4 Input External unit number Return value INTEGER*4 -orINTEGER*8 Output File descriptor if file is connected; -1 if file is not connected An INTEGER*8 result is returned when compiling for 64-bit environments Example: getfd(): INTEGER*4 fildes, getfd, unitn/1/ open( unitn, file='tgetfd.data' ) fildes = getfd( unitn ) if ( fildes .eq. -1 ) stop 'getfd: file not connected' write(*,*) 'file descriptor = ', fildes end See also open(2). Chapter 1 Fortran Library Routines 47