How to put a output file in a network path with Fortran f90

Join the discussion
Registration is free. Start your own thread to ask a follow-up.
2 replies · 3K views
socorroros
Messages
1
Reaction score
0
Hello Folks

I have a program code in Fortran f90, that program generate an output file and put that into the same directory where the program resides, I need to put that output file in a network path ex: \\server_name\resource_shared

I will appreciate if you could provide me the commands in fortran to do this

Thank you very much in advance and regards
 
Physics news on Phys.org
You can specify the path when declaring the output device, so I'd think the path could be a network drive.

PROGRAM OUT_FILE_TEST
OPEN (12,file='C:\$User\OUT.TXT')
WRITE (12,*) 'This is a test writing to C:\$User\OUT.TXT'
CLOSE (UNIT=12)
END PROGRAM OUT_FILE_TEST
 
socorroros said:
Hello Folks

I have a program code in Fortran f90, that program generate an output file and put that into the same directory where the program resides, I need to put that output file in a network path ex: \\server_name\resource_shared

I will appreciate if you could provide me the commands in fortran to do this

Thank you very much in advance and regards

Hey socorroros and welcome to the forums.

One thing that you can do is to map a network path to a drive. You can do this in windows. Something like this should help:

http://www.linglom.com/2008/09/28/how-to-map-a-network-drive-on-windows/