in reply to Re: Find and Replace from File List
in thread Find and Replace from File List
One consideration is to the extent possible, leave the system in a "known state" even if whole O/S bombs or program bombs, meaning even some function which the modification program called "bombed" and process was killed.
So in general, I would recommend making a copy of the original file and modify that "new copy" until we are happy with it. Leave the original alone! The last thing to do is to close the ".new" copy, unlink the original, then rename the ".new" version to the original name. The idea is to make the "time window" where the machine is in an unknown state (between "old" and "new") as small as possible.
The "yeah, butt's" with this are legion. On some O/S's, I can unlink a file, put a new file with same name in directory and folks that have that say old.dll open continue to use the old version because once a file is open, the name is irrelevant...the program is using a file handle, not a name in a directory. New programs that start will get new.dll. A good Windows installation program will register what is called a "run-once" program. This program runs if the OS reboots during the install to clean things up. The installer will remove this "run-once" deal after all it wanted to do was successful (so it doesn't run on the next re-boot).
Already talked too long about this, but there are some definite "yeah, butt's" to be considered when modifying files. I would move "old-previously-modified" files to some area where they are just history of no real consequence after some period of time. And then periodically delete them.
|
|---|