Hi,

This is to report an issue that I have run into while using tar.

*Issue* - tar destroys file when arguments are passed in wrong order
leading to loss of data.

*Correct tar order* - tar -cvzf "archive_file_name" "file_to_be_archived"

*Order actually passed* - tar - cvzf "file_to_be_archived"
"archive_file_name"

tar ignores the fact that the "file_to_be_archived" exists and simply
overwrites it, and then crashes out complaining that "archive_file_name"
doesn't exist.

While I agree that the command was passed by the user in the wrong order, I
feel it's something that is quite possible and tar should follow a
defensive approach of complaining that a file exists rather than
overwriting it.

I've been using tar for years and I ended up passing the wrong arguments
today, which led to me losing data :-(

Thanks,
Pulkit and Meghna

Reply via email to