Open jellykells opened 3 years ago
One way this behavior can be worked around is by using a logical operator in bash:
davix-get [OPTIONS ...] <url> [temporary_file] && mv [temporary_file] [local_file]
But ideally davix-get wouldn't write the empty file at all.
Consider the following case:
Use davix-get to retrieve a file from a remote server.
The retrieval is successful and the file is written. :)
Use davix-get again to retrieve an updated version of the same file.
The retrieval fails due to some error (e.g. name resolution failure), and the old file is overwritten with an empty file. :(
For some context, I use davix to synchronize SSL certificates between multiple remote computers. A temporary failure caused davix to overwrite the certificates with empty files, resulting in errors from the programs using those certificates.