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

Click For Summary
SUMMARY

The discussion focuses on how to modify a Fortran f90 program to output files to a network path instead of the local directory. The user seeks guidance on the specific Fortran commands required to achieve this. A suggested solution includes mapping the network path to a drive letter in Windows, which can simplify the file output process. The example provided demonstrates opening a file in a local directory, indicating that similar commands can be adapted for network paths.

PREREQUISITES
  • Understanding of Fortran f90 programming syntax
  • Familiarity with file I/O operations in Fortran
  • Knowledge of network path formatting in Windows
  • Experience with mapping network drives in Windows
NEXT STEPS
  • Learn how to map a network drive in Windows
  • Explore Fortran f90 file I/O functions and their parameters
  • Investigate error handling in Fortran file operations
  • Review best practices for managing file paths in Fortran programs
USEFUL FOR

Fortran developers, systems programmers, and anyone involved in file management across networked environments will benefit from this discussion.

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
 
Technology 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/
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
3K
Replies
1
Views
6K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 59 ·
2
Replies
59
Views
12K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 29 ·
Replies
29
Views
6K