Hello Paul,
I have a C# app that is doing a series of coordinated disk writes. I want
to
prevent or postpone the death of my process by the user while I am in the
middle of this sequence. Can I do this?
Like Larry already mentioned, you cannot postpone or disable killing of your
application; if that would be possible, think about all malicious
applications like viruses, how could you ever get rid of them if killing
wouldn't work?
Now then, regarding your question about coordinated or atomic disk writes.
Currently, most database applications use the concept of transactions, which
are most often implemented using a log file and the actual database file.
When data is written to the database, it goes to the log file first (1).
Then, upon commit it is written to the database (2), and finally the log
file is cleared (3). The system is built so that it can later on detect, if
for example the system crashes between 2 and 3, for instance because of a
power failure.
Finally, an idea to your solution. Unless you want to start using SQL
databases or write your own log file/transaction support, I suggest taking a
look at Transactional NTFS (TxF), which is a new feature in Windows Vista ja
forthcoming Windows Server 2008:
http://msdn2.microsoft.com/en-us/library/aa365456.aspx
This feature would be exactly what you are looking for: transactions on the
NTFS file system. Works like a charm.
Good luck!
--
Regards,
Mr. Jani Järvinen
C# MVP
Helsinki, Finland
(e-mail address removed)
http://www.saunalahti.fi/janij/