
Hi Mike, On Mon, Jun 25, 2012 at 3:41 PM, Mike Graham <mikegraham@gmail.com> wrote:
Thanks, though this sounds like another mechanism than the one I'm aiming for :-) I want to replace an existing file temporarily, and then restore it no matter what.
This is a very valid concern -- if the process dies unexpectedly I'd leave the file replaced and the original in some temporary directory. Not sure if there's a way around that, probably not.
I don't really like the name Backup but I can't think of a better name at the moment.
Me neither. Thanks, - Kim

Am 25.06.2012 17:03, schrieb Kim Gräsman:
Your algorithm doesn't take SIGKILL, SIGSEV or server crash into account. I don't see a chance to compensate for these problems. How about you fix the 3rd party code instead? -1 for addition of broken code. Sorry ;) Christian

It seems to me it would be easier to patch the 3rd party library code and submit the patch to them, than to do this. There are other ways to manipulate the file system to achieve what you are attempting.. but somewhere along the line you would have to interact with another program. If you taught the shell to clean up after your act, then this could be achieved in the event of a power failure. You could even write a wrapper shell for Python. I think perhaps the case is too niche for that kind of solution -- Be prepared to have your predictions come true

Am 25.06.2012 17:03, schrieb Kim Gräsman:
Your algorithm doesn't take SIGKILL, SIGSEV or server crash into account. I don't see a chance to compensate for these problems. How about you fix the 3rd party code instead? -1 for addition of broken code. Sorry ;) Christian

It seems to me it would be easier to patch the 3rd party library code and submit the patch to them, than to do this. There are other ways to manipulate the file system to achieve what you are attempting.. but somewhere along the line you would have to interact with another program. If you taught the shell to clean up after your act, then this could be achieved in the event of a power failure. You could even write a wrapper shell for Python. I think perhaps the case is too niche for that kind of solution -- Be prepared to have your predictions come true
participants (4)
-
Christian Heimes
-
Christopher Reay
-
Ethan Furman
-
Kim Gräsman