Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29276 Discussions

reading redirected input by windows application

sgongola
Beginner
409 Views
We have a windows application sometimes runs as a batch
and gets input by reading redirected data as standard
input instead of getting screen input

pgmname.exe

How can i determine if the redirect specification is there. I tried to use inquire to determine if the file exists using
fname='CONIN$'
inquire (file=fname,exist=exists)
but it always returns true.
0 Kudos
1 Reply
Jugoslav_Dujic
Valued Contributor II
408 Views
Check out GetFileType API. GetFileType(GetStdHandle(STD_INPUT_HANDLE)) should (didn't try it) tell you whether it's a file (FILE_TYPE_DISK) or keyboard stream (FILE_TYPE_CHAR).

Jugoslav
0 Kudos
Reply