PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Redirecting the output to /dev/null

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
strider



Joined: 17 Jan 2005
Posts: 1

PostPosted: Mon Jan 17, 2005 12:41 am    Post subject: Redirecting the output to /dev/null Reply with quote

Hello,

I would like redirect output from several sources to /dev/null file. When I try to run this file:
Code:

      program test

      open(1,file='/dev/null')
      open(2,file='/dev/null')

      end

I get an error:
    PGFIO-F-207/OPEN/unit=2/file is already connected to another unit.
    File name = /dev/null
    In source file test.f, at line number 4

Is there anything I can do?

Thanks in advance.
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6134
Location: The Portland Group Inc.

PostPosted: Mon Jan 17, 2005 12:20 pm    Post subject: Reply with quote

Hi Strider,

Unfortunately, we do not make any distinction of '/dev/null' from any other file and thus do not allow you to open it twice. However, you might be able to get the same behavior if you use "SCRATCH" files instead of redirecting the output. The output will be sent to this temporary file and when the program exits, the file is deleted.

Code:
     program test
          open(1, status='SCRATCH')
          open(2, status='SCRATCH')
     end


Hope this helps,
Mat
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group