Re: GNU Tar on Windows XP

[email protected] (Bob Proulx)
Newsgroups gmane.comp.gnu.utils
Message-ID <[email protected]>
Gadrin wrote:
> do you get only folders and the structure (no files) on a test on your
> system ?

Correct.  I only get directories not files.

Here is a test hierarchy of directories and files.

  mkdir dir1 dir2 dir3
  mkdir dir1/foo
  mkdir dir1/foo/bar
  mkdir dir2/foo
  touch dir1/foo/bar/FILE
  touch dir1/foo/FILE

  find . -exec ls -ldog {} +
  drwxrwxr-x 5 4096 2008-03-02 22:54 .
  drwxrwxr-x 3 4096 2008-03-02 22:54 ./dir1
  drwxrwxr-x 3 4096 2008-03-02 22:54 ./dir1/foo
  -rw-rw-r-- 1    0 2008-03-02 22:54 ./dir1/foo/FILE
  drwxrwxr-x 2 4096 2008-03-02 22:54 ./dir1/foo/bar
  -rw-rw-r-- 1    0 2008-03-02 22:54 ./dir1/foo/bar/FILE
  drwxrwxr-x 3 4096 2008-03-02 22:54 ./dir2
  drwxrwxr-x 2 4096 2008-03-02 22:54 ./dir2/foo
  drwxrwxr-x 2 4096 2008-03-02 22:54 ./dir3

Here is a test case:

  find . -type d | tar cf - -T- --no-recursion | tar tvf -
  drwxrwxr-x bob/bob           0 2008-03-02 22:54 ./
  drwxrwxr-x bob/bob           0 2008-03-02 22:54 ./dir1/
  drwxrwxr-x bob/bob           0 2008-03-02 22:54 ./dir1/foo/
  drwxrwxr-x bob/bob           0 2008-03-02 22:54 ./dir1/foo/bar/
  drwxrwxr-x bob/bob           0 2008-03-02 22:54 ./dir3/
  drwxrwxr-x bob/bob           0 2008-03-02 22:54 ./dir2/
  drwxrwxr-x bob/bob           0 2008-03-02 22:54 ./dir2/foo/

Only directories are processed.  Works for me.

Bob
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.