On Sun, Oct 4, 2009 at 4:16 AM, Sergey Poznyakoff <[email protected]> wrote: > Bart Botta <[email protected]> ha escrit: > >> $ ../src/tar cfv a --remove-files b >> ../src/tar: a: Cannot open: Is a directory > > Argument to the -f option cannot be a directory. See >
Right, I wasn't expecting it to actually create an archive, that was just a convenient way to make it fail. If you prefer, here is another version, which fails due to permissions: $ mkdir a $ chmod -xw a $ mkdir b $ touch b/c $ tar cfv a/d.tar --remove-files b tar: a/d.tar: Cannot open: Permission denied tar: Error is not recoverable: exiting now $ ls b c $ tar cfvz a/d.tar --remove-files b tar: a/d.tar: Cannot open: Permission denied tar: Error is not recoverable: exiting now b/ b/c tar: Child returned status 2 tar: Error exit delayed from previous errors $ ls b ls: cannot access b: No such file or directory $ ls a/ the point is that tar should actually 'exit now' when it says 'exiting now' instead of proceeding to delete the files without putting them in a usable archive. -- 3b
