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

Sending output to null file

a_leonard
Beginner
520 Views

Will this work on Windows if we want to have a "quiet" mode for our code that prevents output to a certain file?  I don't see it documented anywhere, but I came across some references to it on the internet (not this forum).

open(iunit,file='NUL')

I could add some logic to conditionally write, based on the value of some flag, but there are probably hundreds of places we might write to this file.  On Unix platforms I would change the file name to '/dev/null'.

0 Kudos
1 Reply
Steven_L_Intel1
Employee
520 Views
Yes, this works. See the MSDN documentation for the CreateFile function for more possibilities.
0 Kudos
Reply