Assaf Gordon wrote:
An explicit error explicitly saying "cannot move", and mention the source and
destination, and also "blames" the target directory seems the most
user-friendly and least ambiguous.

Sure, but that handles only the ENOTEMPTY/EEXIST case. How would you handle the EDQUOT, EISDIR, and ENOSPC cases? Will you invent a separate diagnostic for each case, or just treat them as in my proposed patch? I assume the latter, but either way I'd like to see a patch that handles these properly too. Also, please handle ETXTBUSY while you're at it (sorry, I missed that one).

For the second and third cases,
"No space" and "Quota exceeded" seem to me to always relate to the
destination, and I don't think users get confused about those
(other opinions of course welcomed).

What's obvious to experts like us is not always obvious to users. If users get confused by the current diagnostic for ENOTEMPTY/EEXIST, I don't see why they wouldn't also get confused for ETXTBUSY etc.

Your patch also added "EISDIR", for which rename(2) says:
 "newpath is an existing directory, but oldpath is not a directory."

But I don't think this error can happen with gnu mv.

It can, as a result of a race condition if some other process is mutating the file system while 'mv' is running. Admittedly unlikely, but we might as well improve this errno value while we're improving the others.



Reply via email to