Is there a program that can watch files for write access and log those?
I have an annoying case of a corrupted prefs file. It happens when a program crashes (not a specific one, just any program crash. It happens randomly on a simple reboot (fast, hard, sync or not doesn't matter) It happens a fter some down time on simple boot.
I KNOW that it does NOT happen on startup/boot, but right before WB goes to reboot or a program crashed...i know that because i tried locking WB at first command in startup-sequence and unlocking it after all programs were up.
I could read protect the file, but then i a) wouldn't be able to change/save the prefs without the extra step of making the file writable again 2) wouldn't see which program tried to corrupt the file (as i only get the warning that the file is write protected, but not from which program) d) couldn't gather information about the culprit and in turn violently delete the corrupting piece of dead-bits
Is there such a program
...oh, and if anyone has the same problem, please share...for me it's ENVARC:Sys/ringhio.appsprefs.xml that randomly ends up with a corrupted prefs file (together with a window on boot telling me that line xxx has some error or something, also not even with the information of what programs sends the error)
I know it's ringhio because i created a backup and i use custom sounds which always gets set back to that stupid harp (i can't hear anymore)
While it's an interesting concept the program is aimed towards script usage.
Also, the output possibilities with "More" are limited to the changed files contents, which i don't need, i need the name of the program that does the change/corrupts the file, e.g. MultiEdit/Notepad for a test.
I'm going with "protect -wd" as a workaround for now, annoying but at least i can work without always having to change my settings back.
Is something installing a reset-handler which maybe writes to the file but doesn't finish writing quick enough (or it ends up in memory cache rather than on disk and reboots before sync)
Not sure if it's possible to find out which reset-handlers are installed.
I need to check which reboot program exactly I'm using (I keep losing track of such details since I tend to automate anything with scripts nowadays.) In any way, if the sync switch is screwing things up, it's a bug in the program and need to ge resolved imho
I'm using a reboot command (not sure which one) which has a sync command attached to it.
Maybe it's simply the default C:Reboot? It has a SYNC option.
If it is, you could try, instead of the SYNC, to use e.g. WAIT 5.
That should normally give enough time for write operations to finish, so the reset is less likely to cause problems.
Edit: BTW, the SYNC option in C:Reboot does not (as per my understanding) notify any programs or similar, it just inhibits all volumes, so they can't be written to.
Probably, that could be it then. Maybe im just unlucky in the prefs file being written to while the drive gets locked? Then again, that would be extremely coincidental while happening nearly all the time...
If it works as nbache says, then the sync might be blocking the drive and then the reboot happens, but due to timing the inhibit may not be completely done. If Ringhio has added a reset-handler which saves prefs on reboot then that could cause it to half write the file before the drive is protected. Result - corrupt file.
..oh, and if anyone has the same problem, please share...for me it's ENVARC:Sys/ringhio.appsprefs.xml that randomly ends up with a corrupted prefs file (together with a window on boot telling me that line xxx has some error or something, also not even with the information of what programs sends the error)
I know it's ringhio because i created a backup and i use custom sounds which always gets set back to that stupid harp (i can't hear anymore)
What version of Notifications are you using? I fixed a race condition with prefs reading code that might cause arbitrary corruption in the prefs file (or at least make it seem corrupt when it wasn't)