**Tutorial** - Using filemon to look at what files Freelance
The following is a quick explanation of one technique for finding out what files Freelancer is using at a particular point in the game. This may be useful for some advanced modders trying to debug problems. Sorry, no screenshots immediately available.
This can be useful to determine when Freelancer is reloading INI files, or to help determine what data caused a crash if FLSpew isn't helpful. I'll walk through an example of using filemon to examine what happens to INI files as you go through a jumpgate.
1. Get the filemon utility from Sysinternals; download link is at the bottom of the page.
2. Start up Freelancer, navigate to a jumpgate, but don't dock.
3. Switch away from Freelancer to explorer (easy enough to do by hitting the Windows key usually), and start up FileMon. If this is the first time you are running it, it will begin spewing data right away. That's OK, we can trim it down and will in the next few steps. It is returning information about every single file enumerate/open/read/close event on your system.
4. First, go to the File menu in FileMon and UNCHECK the "Capture Events" item from it while we configure FileMon. Now go to the "Edit" menu and select "Clear Display" to dump the current information.
5. Set up FileMon Filtering.
FileMon returns so much data its easy to get lost. To help with that, we now go to the Options menu and select "Filter/Highlight". We can use this to filter the information coming back to you.
Assuming you used the standard install folder "C:\Program Files\Microsoft Games\Freelancer", you can select ONLY references to the actual INI files in data by using the following in the first line. the "include" filter:
<pre><font size=1 face=Courier><font size=1 face=Courier>C:\Program Files\Microsoft Games\Freelancer\Data\*.ini </font> </font></pre>
If you were wanting to look at all files so you could see MAT/CMP/SUR references too, you can change this to
<pre><font size=1 face=Courier><font size=1 face=Courier>C:\Program Files\Microsoft Games\Freelancer\Data\* </font> </font></pre>
If you want to highlight some lines - for example, those referencing the Li01 system ini files - you could make the Highlight entry <pre><font size=1 face=Courier><font size=1 face=Courier>Li01 </font> </font></pre>.
At the bottom of the filter window are 3 checkboxes for "Log Opens", "Log Reads", and "Log Writes". Freelancer doesn't usually write to files in the data path, but you might want to uncheck everything except for "Log Reads" to get rid of miscellaneous redundant information.
When you're done, Click OK. These will be your default settings the next time you run FileMon, so you don't need to repeat this all the time.
6. Turn monitoring back on.
Go back to the File menu, and select "Capture Events"; a checkmark will appear next to it if you pop the menu again, showing that event capture is on.
7. Switch back to Freelancer, then dock and wait until you get through the gate and have control of your ship again. Then switch away from Freelancer.
8. Filemon should show a lot of activity. If you were going into the New York system, there will be plenty of highlighted lines for Li01 files. The detailed technical information may not be helpful, but you can see exactly which files Freelancer read from and it what order it read them.
9. Saving the info
There's a lot there, too much for easy reading, but you may want to save the information to look through. To do that, go to File / Save As. The saved files separate data with tabs, so if you have a spreadsheet program such as Excel, you can open it from that and delete columns you aren't interested in.
Edited by - WatercoolerWarrior on 12/12/2004 4:08:55 AM
This can be useful to determine when Freelancer is reloading INI files, or to help determine what data caused a crash if FLSpew isn't helpful. I'll walk through an example of using filemon to examine what happens to INI files as you go through a jumpgate.
1. Get the filemon utility from Sysinternals; download link is at the bottom of the page.
2. Start up Freelancer, navigate to a jumpgate, but don't dock.
3. Switch away from Freelancer to explorer (easy enough to do by hitting the Windows key usually), and start up FileMon. If this is the first time you are running it, it will begin spewing data right away. That's OK, we can trim it down and will in the next few steps. It is returning information about every single file enumerate/open/read/close event on your system.
4. First, go to the File menu in FileMon and UNCHECK the "Capture Events" item from it while we configure FileMon. Now go to the "Edit" menu and select "Clear Display" to dump the current information.
5. Set up FileMon Filtering.
FileMon returns so much data its easy to get lost. To help with that, we now go to the Options menu and select "Filter/Highlight". We can use this to filter the information coming back to you.
Assuming you used the standard install folder "C:\Program Files\Microsoft Games\Freelancer", you can select ONLY references to the actual INI files in data by using the following in the first line. the "include" filter:
<pre><font size=1 face=Courier><font size=1 face=Courier>C:\Program Files\Microsoft Games\Freelancer\Data\*.ini </font> </font></pre>
If you were wanting to look at all files so you could see MAT/CMP/SUR references too, you can change this to
<pre><font size=1 face=Courier><font size=1 face=Courier>C:\Program Files\Microsoft Games\Freelancer\Data\* </font> </font></pre>
If you want to highlight some lines - for example, those referencing the Li01 system ini files - you could make the Highlight entry <pre><font size=1 face=Courier><font size=1 face=Courier>Li01 </font> </font></pre>.
At the bottom of the filter window are 3 checkboxes for "Log Opens", "Log Reads", and "Log Writes". Freelancer doesn't usually write to files in the data path, but you might want to uncheck everything except for "Log Reads" to get rid of miscellaneous redundant information.
When you're done, Click OK. These will be your default settings the next time you run FileMon, so you don't need to repeat this all the time.
6. Turn monitoring back on.
Go back to the File menu, and select "Capture Events"; a checkmark will appear next to it if you pop the menu again, showing that event capture is on.
7. Switch back to Freelancer, then dock and wait until you get through the gate and have control of your ship again. Then switch away from Freelancer.
8. Filemon should show a lot of activity. If you were going into the New York system, there will be plenty of highlighted lines for Li01 files. The detailed technical information may not be helpful, but you can see exactly which files Freelancer read from and it what order it read them.
9. Saving the info
There's a lot there, too much for easy reading, but you may want to save the information to look through. To do that, go to File / Save As. The saved files separate data with tabs, so if you have a spreadsheet program such as Excel, you can open it from that and delete columns you aren't interested in.
Edited by - WatercoolerWarrior on 12/12/2004 4:08:55 AM