tramp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: file-precious-flag


From: Michael Albinus
Subject: Re: file-precious-flag
Date: Fri, 14 Aug 2009 15:41:08 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Julian Scheid <address@hidden> writes:

> I'm looking at the end of tramp-handle-write-region and I can see that
> when file-precious-flag is set, checksums are run to verify that the
> file was written as expected.
>
> However, file-precious-flag documentation says "non-nil means protect
> against I/O errors while saving files" and goes on to explain how this
> is achieved by writing to a temporary file and then swapping out the
> temporary file against the target. Wouldn't it make sense for tramp to
> do the same? Unless I'm missing something, tramp will raise an error
> when the checksums don't match but it seems at that point the damage
> is already done.

You're touching pretty old code :-)

Tramp's usage of file-precious-flag is a kind of misuse. It was added,
when the chunksize problem was repeatedly reported by customers. Tramp
cannot solve the problem, but it can warn. That's what behind.

Maybe it is useful indeed, in the case of file-precious-flag, to write
first to a temporary remote file, and then to move that file (when the
check shows everything is fine). Feel free to provide a patch.

Take into account, that tramp-handle-write-region was patched again and
again; maybe it is worth to review the code, and to clean it up.

Best regards, Michael.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]