- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello!
I made a Fortran dll called by a C# exe.
It's working directory is F:\\project\\...\\bin
A character variable fnamecontains the file absolute pathsuch as: F:\\data\\a.txtin the dll.
Dll with CODE A cannot work. It says 'file not found'. It seems that fname was considered as an relative path under the working directory.
Dll with CODE B works fine.
The opened file name must be a variable. How could I fix it? Thanks.
I made a Fortran dll called by a C# exe.
It's working directory is F:\\project\\...\\bin
A character variable fnamecontains the file absolute pathsuch as: F:\\data\\a.txtin the dll.
[fortran]!!CODE A: open(3,file=fname,form='formatted',action='read') read(3,*) var ... close(3) !!CODE B: open(3,file='F:\data\a.txt',form='formatted',action='read') read(3,*) var ... close(3)[/fortran]
Dll with CODE A cannot work. It says 'file not found'. It seems that fname was considered as an relative path under the working directory.
Dll with CODE B works fine.
The opened file name must be a variable. How could I fix it? Thanks.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you sending FNAME from C#? Can you check the exact string held by fname in code A?

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page