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

capture STDOUT from CALL SYSTEM

rreis
New Contributor I
886 Views
Hi

Is it possible, using only fortran, to capture stdout from a call system() invocation?

best,
0 Kudos
1 Solution
Ron_Green
Moderator
886 Views
Quoting - rreis
whithout capturing it to a file and reading it later, off course...

Yes, that would be useful and I've needed this capability. Unfortunately I know of no way to do this from just Fortran - other than the redirection of output to a file which is then opened and read.

View solution in original post

0 Kudos
3 Replies
rreis
New Contributor I
886 Views
whithout capturing it to a file and reading it later, off course...
0 Kudos
Ron_Green
Moderator
887 Views
Quoting - rreis
whithout capturing it to a file and reading it later, off course...

Yes, that would be useful and I've needed this capability. Unfortunately I know of no way to do this from just Fortran - other than the redirection of output to a file which is then opened and read.
0 Kudos
roddur
Beginner
886 Views

Yes, that would be useful and I've needed this capability. Unfortunately I know of no way to do this from just Fortran - other than the redirection of output to a file which is then opened and read.
Ah! Would rreis post it a day earlier, and ronald replied, it would have save me few days!!i was stuck with same problem with
call system ('uname -snm>>file.log') to run only to see this happns to stdout but not in other file.
i had to have a short encounter with c to do this....thanks to both of you.
0 Kudos
Reply