- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have an old Fortran file (exe) that writes to a text file. The name of the text file is built in and I cannot change it. I do not have the code.
Once the file is open the program writes to it about 2000 times per second, and the program needs to run for days if not months.
Is there anyway in Fortran to read or copy or something to get access to the data? whilst it is open and being written to? I want to read it about as often as the writes?
Can I decompile the exe file?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can't decompile into anything useful.
As for accessing the file while it is being written, that depends on the options specified when the file was opened for writing. The default is no shared access, and the OS will block you.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can't decompile into anything useful.
As for accessing the file while it is being written, that depends on the options specified when the file was opened for writing. The default is no shared access, and the OS will block you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The name of the file is somewhere in the executable. With an hexadecimal editor, you can search for it and change the name to a more convenient (CON or NUL for example).The name can be duplicated in the executable and it's risky if the new name is longer than the previous.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Does the program use the Fortran .dll runtime library? If so, then you could be able to locate the dispatch table for the Fortran Open function and patch it (hook it) to filter the arguments. Upon entry to the filter, when the name is noted as being that of the current output file, you can change the name... .AND. change the open mode to support shared access while being written. You could also add a filter for the WRITE for example to report count of I/O's (reading the file size does not necessarily show the correct information due to I/O buffering).
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the suggestions. The code reads a serial port. After reading Steve's note, I realized the program reads to and from a serial port. I found a port sniffer and noted the ASCII codes going to the port and the return values.
I could write a short program to just do the parts I needed. It has taken two days so I am happy.
Biggest problem is the blasted device does not always follow its manual, a serial port should read the manual.
The name of the interrupt code is the name of the company that made the device.

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