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

How to put a output file in a network path

carmenr1974
Beginner
432 Views

Hello Folks

I need to create a code in Intel Visual Fortran, that program generate an output file. 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! please

Thank you in advance and regards

0 Kudos
1 Reply
anthonyrichards
New Contributor III
432 Views
Try the attached as a console program (enter your own //servername/diskname/ ).
It worked OK for me:

program networkfile

program networkfile
implicit none
character(256) filename, record
filename="//sstdfile01/optics/helloworld.txt"
open(unit=10, file=filename, form="formatted",status="unknown")
write(10,*) 'Hello World'
close(10)
open(unit=10, file=filename, form="formatted",status="unknown")
read(10,'(a256)') record
close(10)
print *,trim(record)
pause
end program networkfile

Please note that, because it is accessing a network drive, there may be several seconds delay sometimes between writing and reading the file.

0 Kudos
Reply