Re: [Bug-tar] The empty tar file
Charles Swiger wrote: > No; it's not considered an error to create a tar file which archived zero > files. In addition: modern tar implementations like star (that implement buffering) would have problems to delay opening the archive until the first "usable" file was found. Jörg -- EMail:jo...@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin j...@cs.tu-berlin.de(uni) joerg.schill...@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.berlios.de/private/ ftp://ftp.berlios.de/pub/schily
Re: [Bug-tar] The empty tar file
On 17/10/13 04:20 PM, Charles Swiger wrote: > Hi-- > > > On Oct 17, 2013, at 2:10 AM, devkumar@bt.com wrote: >> Hi GNU Team, > Well, this is a mailing list for GNU tar, but there are a number of non-GNU > folks lurking around here. :-) > >> This is regarding the creation of tar archive from files dropped to unix >> through a windows filer. >> >> Files like ‘call for complaint.txt’ are being considered as three different >> arguments for the tar command. > Yes, that's standard Unix shell behavior. > Use backslashes or quotes to surround filenames containing spaces: > > tar cf nofile.tar call\ for\ complaint.txt [ ...or... ] > tar cf nofile.tar 'call for complaint.txt' > >> >> >> The archive Nofile.tar.Z is being created with 164 bytes although it doesnot >> contain any files. >> >> Is there any way to stop the tar command from generating the .tar archive if >> the files don’t exist? > No; it's not considered an error to create a tar file which archived zero > files. > GNU tar refuses to make an archive for "no files". Some might argue that it should also refuse to make an archive for "non-existent files". I wrote a patch for this, the last time it came up and so far no one has commented on it: http://lists.gnu.org/archive/html/bug-tar/2013-09/msg00038.html signature.asc Description: OpenPGP digital signature
Re: [Bug-tar] The empty tar file
Hi-- On Oct 17, 2013, at 2:10 AM, devkumar@bt.com wrote: > Hi GNU Team, Well, this is a mailing list for GNU tar, but there are a number of non-GNU folks lurking around here. :-) > This is regarding the creation of tar archive from files dropped to unix > through a windows filer. > > Files like ‘call for complaint.txt’ are being considered as three different > arguments for the tar command. Yes, that's standard Unix shell behavior. Use backslashes or quotes to surround filenames containing spaces: tar cf nofile.tar call\ for\ complaint.txt [ ...or... ] tar cf nofile.tar 'call for complaint.txt' > > > The archive Nofile.tar.Z is being created with 164 bytes although it doesnot > contain any files. > > Is there any way to stop the tar command from generating the .tar archive if > the files don’t exist? No; it's not considered an error to create a tar file which archived zero files. Regards, -- -Chuck