3

I'm trying to use tar to tar files before transfer, so I can keep the entire file path rather than losing it along the way. However, when I try to tar an empty folder, it tells me that it is cowardly refusing to create an empty archive. I want to keep the empty folder on the other end, but don't want to put anything else into the archive to make it non-empty. Is there any way to do this?

1

1 Answer 1

3

What command are you using? I am able to create a tar archive of an empty directory just fine:

[jnet@Stan tmp]$ mkdir test
[jnet@Stan tmp]$ tar -cf test.tar test
[jnet@Stan tmp]$ ls -lh test.tar 
-rw-r--r--  1 jnet  wheel    10K Apr 20 21:58 test.tar
6
  • Looking at your answer, I realized I forgot the first argument... so this is really just an ID10T error. Thanks for helping anyway!
    – dieki
    Commented Apr 21, 2010 at 2:03
  • You know it's cowardly to create an empty archive right? ;-)
    – Josh
    Commented Apr 21, 2010 at 2:18
  • @josh: i'm pretty sure it was the refusal to create an empty archive that was "cowardly". tho i'm not remembering who says that. is that a tar error or somebody else? Commented Apr 21, 2010 at 3:15
  • snostorm@ubuntu:~$ tar -cf filename tar: Cowardly refusing to create an empty archive Try tar --help' or tar --usage' for more information.
    – dieki
    Commented Apr 21, 2010 at 11:32
  • So that's a tar error. :)
    – dieki
    Commented Apr 21, 2010 at 11:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .