Quote:
Originally Posted by
mohtashims
I wish my tar -xf hello.tar command should return successful even if the tar has already been extracted at the same location
And i wish i had better thought-through questions to answer. Seems like we both don't get what we want.
How should
tar know it "has already been extracted", hmm?
- how would tar know at all, because if the pathes in an archive are relative the archive could have been unpacked into a very different place in the filesystem;
- even if there are some files matching the name of files in the archive - how would
tar find out if they are complete or if some are missing?
- even if the unpacked file collection is complete, how would
tar find out if they are of the same content as the ones in the archive (that is,without actually unpacking them all and running a - hypothetical - "binary
diff" against every one of them?
- and even if such a hypothetical analysis would turn out to be successful, how would
tar make sure the surely existing diferences in inode content (mtime, ctime, owner, whatever) doesn't matter? Which (amount of) difference exactly should
tartolerate and still consider a specific pair of files (in- and outside the archive) to be equal?
What you want: doesn't exist, is theoretically impossible (and actually against the law of thermodynamics, so its safe to say it will never exist). Does that answer your question?
I hope this helps.
bakunin