This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch, libfortran] PR44931 For INPUT_UNIT, INQUIRE NAME= should not return "stdin"


Tobias Burnus wrote:

> Besides, I wonder whether using "" as string is better than using the
> default std{in,out,err} in case ttyname fails. (This happens for
> instance if the standard I/O redirected to a file or pipe.) 

For Linux, we could return /proc/self/fd/1 for standard output (0 and 2
correspondingly).  This appears to work, as this little program shows:

program main
  implicit none
  open(unit=10,file='/proc/self/fd/1')
  write (10,*) 'Hello, world!'
end program main

	Thomas


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]