Read and respond to this message at: 
https://sourceforge.net/forum/message.php?msg_id=7428576
By: keithmarshall

If I understand you correctly, you have an archive file in some directory, (you
called it "dir_2"), and you want to extract it into another directory, (which
you called "dir_3")?

Right.  tar will, by default, extract into your current working directory,
reinstating the hierarchy specified within the archive itself, relative to 
current
directory as prefix.  Thus, provided you didn't make the grave error of creating
the archive with absolute path names:

  $ cd d:\path\to\dir_3
  $ tar xvf d:\path\to\dir_2\archive.tar

should achieve what you want.  (If you *did* create the archive, specifying
*absolute* path names for the archived files, then I fear tar will always 
extract
back to the same absolute paths; the moral is: *never* specify absolute path
names for the files you add to a tar archive, *always* use a relative path).

In an earlier post, you said you did:

  $ cd dir_2
  $ tar xvf archive.tar -C dir_3

(exploiting the GNU tar -C extension feature), and it didn't work.  I've never
seen that fail, (but then, I use the MSYS implementation of GNU tar, rather
than GnuWin32's).  When you invoked that command, did your "dir_3" already exist
as a subdirectory of "dir_2"?  (Hint: tar will try to cd to the directory 
specified
with -C; if it doesn't exist, that must fail; tar will not call mkdir for you).

______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit: 
https://sourceforge.net/forum/unmonitor.php?forum_id=74807

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
GnuWin32-Users mailing list
GnuWin32-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnuwin32-users

Reply via email to