- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
how to detect an arbitrary file's path in Fortran source code?
for example, it is a .exe file.
the following dll function can only return the path of the file generating the current process.
path_len = GetModuleFileName (NULL, path, &
len(path))
How to detect a .exe file's path, this file may not run in this time.
Thank you for your help!
for example, it is a .exe file.
the following dll function can only return the path of the file generating the current process.
path_len = GetModuleFileName (NULL, path, &
len(path))
How to detect a .exe file's path, this file may not run in this time.
Thank you for your help!
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, there may be only one .exe file which started the current process, and that's the one retrieved with GetModuleFileName(NULL). If you want a currently loaded dll, use Dll name as the first argument.
If a non-exe file is not fully qualified with path, it is searched for in the current directory (e.g. OPEN(FILE="Foo.txt")). To retrieve the current directory, you can use GetCurrentDirectory.
If a non-exe file is not fully qualified with path, it is searched for in the current directory (e.g. OPEN(FILE="Foo.txt")). To retrieve the current directory, you can use GetCurrentDirectory.

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