bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-tar] Bug with --no-recursion and . or simply user error?


From: deanna dunker
Subject: [Bug-tar] Bug with --no-recursion and . or simply user error?
Date: Fri, 11 Jan 2008 17:47:25 -0500

Hi folks,

I'll first explain three commands that work as expected, then I'll
provide fourth that doesn't quite do what I expect it to do. I've been
banging my head against this for over a full workday and could use
fresh sets of eyes.I tried this mostly on GNU tar version 1.17 but
found the same results in 1.14 from another machine I had tested on.

1. When I perform a tar -cf somefile.tar . it tars the current
directory I'm in, including hidden files & directories.  (expected
behavior)
2. When I perform a  tar -cf somefile.tar * it tars the current
directory I'm in, excluding hidden files & directories. (expected
behavior)
3. When I perform a tar -cf somefile.tar --no-recursion *, it tars the
current directory I'm in, and (now empty) directories for non-hidden
directories. It does not include any files in any sub-directories.
(expected behavior)
4. However, when I perform a tar -cf somefile.tar --no-recursion .  it
tars an empty directory called . with no files nor directories in it
what so ever. (not what I expected)

Example:
address@hidden Pictures]$ ls -a .
.  ..  .hiddenfile  .hiddenfolder  realfile  realfolder  someotherfile.txt

address@hidden Pictures]$ sudo tar cf somefile.tar --no-recursion *
address@hidden Pictures]$ tar tf somefile.tar
realfile
realfolder/
someotherfile.txt
address@hidden Pictures]$ sudo tar cf somefile2.tar --no-recursion .
address@hidden Pictures]$ tar tf somefile2.tar
./
address@hidden Pictures]$ sudo tar cf somefile3.tar .
tar: ./somefile3.tar: file is the archive; not dumped
address@hidden Pictures]$ tar tf somefile3.tar
./
./somefile2.tar
./.hiddenfolder/
./.hiddenfolder/.hiddenfileinisidehiddenfolder
./.hiddenfolder/fileinsidehiddenfolder
./realfolder/
./realfolder/realfileinrealfolder
./realfolder/.hiddenfileinrealfolder
./realfolder/someotherfileinrealfolder.txt
./someotherfile.txt
./realfile
./.hiddenfile
./somefile.tar
address@hidden Pictures]$ echo wtf
wtf


Am I simply using it incorrectly? If so, what is a simple way to
non-recursively tar a directory that contains hidden files?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]