public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: tar -C dir option makes dir relative to current dir
@ 2000-09-06  9:14 Bernard Dautrevaux
  0 siblings, 0 replies; 4+ messages in thread
From: Bernard Dautrevaux @ 2000-09-06  9:14 UTC (permalink / raw)
  To: 'Jon Mountjoy', cygwin

> -----Original Message-----
> From: Jon Mountjoy [ mailto:mountjoy@netcomuk.co.uk ]
> Sent: Wednesday, September 06, 2000 4:38 PM
> To: cygwin@sourceware.cygnus.com
> Subject: tar -C dir option makes dir relative to current dir
> 
> 
> Hi All,
> 
> I have read all docs and couldn't solve my problem.  In a 
> make file I have:
>  cd foo && tar blah blah | tar -C j:/foobar
> 
> Now I run the make file from the l: drive (so l:/foo exists).
> 
> The problem is that when the tar on the right gets run, it 
> tries to place
> the files in the directory:
>   /cygdrive/l/foo/j:/foobar
> which of course isn't a valid directory.
> 
> I know I can solve it by not going over another filesystem, 
> but that isn't
> ideal.
> 
> Any ideas?  (I am running latest net release on W2K.  l: and 
> j: are mapped
> drives.  I also tried mounting them, didn't solve a thing. 
> WinNT Ver 5.0
> build 2195,
> Cygwin DLL version i   dll major: 1001     dll minor: 4    
> dll epoch: 19)


Did you try "... | tar -C /cygdrive/j/foobar" ?

The problem here is that for TAR (except if especially changed for cygwin)
j:/foobar is a *relative* path name, not an absolute one (it does not start
by a '/') :-(

The cygwin /cygdrive feature is just for that :-)

--------------------------------------------
Bernard Dautrevaux
Microprocess Ingenierie
97 bis, rue de Colombes
92400 COURBEVOIE
FRANCE
Tel:	+33 (0) 1 47 68 80 80
Fax:	+33 (0) 1 47 88 97 85
e-mail:	dautrevaux@microprocess.com
		b.dautrevaux@usa.net
-------------------------------------------- 

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: tar -C dir option makes dir relative to current dir
@ 2000-09-06  9:43 Earnie Boyd
  0 siblings, 0 replies; 4+ messages in thread
From: Earnie Boyd @ 2000-09-06  9:43 UTC (permalink / raw)
  To: Jon Mountjoy, cygwin

--- Jon Mountjoy <mountjoy@netcomuk.co.uk> wrote:
> Hi All,
> 
> I have read all docs and couldn't solve my problem.  In a make file I have:
>  cd foo && tar blah blah | tar -C j:/foobar
> 
> Now I run the make file from the l: drive (so l:/foo exists).
> 
> The problem is that when the tar on the right gets run, it tries to place
> the files in the directory:
>   /cygdrive/l/foo/j:/foobar
> which of course isn't a valid directory.
> 

As I see it, tar is assuming the j:/foobar is a relative path since the string
doesn't begin with /.  This causes the prefix /cygdrive/l/foo to be added to
make the path absolute.

If you:
   mkdir /j
   mount -b j:/ /j
   tar -C /j/foobar
then tar will see the string beginning with / and not make the false assumption
that the path isn't absolute.

The other option is to modify tar and submit the patches to
cygwin-apps@soures.redhat.com for consideration.

Cheers,

=====
--- < http://earniesystems.safeshopper.com > ---
   Earnie Boyd: < mailto:earnie_boyd@yahoo.com >
            __Cygwin: POSIX on Windows__
Cygwin Newbies: < http://gw32.freeyellow.com/ >
           __Minimalist GNU for Windows__
  Mingw32 List: < http://www.egroups.com/group/mingw32/ >
    Mingw Home: < http://www.mingw.org/ >

__________________________________________________
Do You Yahoo!?
Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: tar -C dir option makes dir relative to current dir
@ 2000-09-06  9:16 Bernard Dautrevaux
  0 siblings, 0 replies; 4+ messages in thread
From: Bernard Dautrevaux @ 2000-09-06  9:16 UTC (permalink / raw)
  To: Bernard Dautrevaux, 'Jon Mountjoy',
	'cygwin@sourceware.cygnus.com'

> -----Original Message-----
> From: Bernard Dautrevaux 
> Sent: Wednesday, September 06, 2000 6:05 PM
> To: 'Jon Mountjoy'; cygwin@sourceware.cygnus.com
> Subject: RE: tar -C dir option makes dir relative to current dir
> 
> 
> > -----Original Message-----
> > From: Jon Mountjoy [ mailto:mountjoy@netcomuk.co.uk ]
> > Sent: Wednesday, September 06, 2000 4:38 PM
> > To: cygwin@sourceware.cygnus.com
> > Subject: tar -C dir option makes dir relative to current dir
> > 
> > 
> > Hi All,
> > 
> > I have read all docs and couldn't solve my problem.  In a 
> > make file I have:
> >  cd foo && tar blah blah | tar -C j:/foobar
> > 
> > Now I run the make file from the l: drive (so l:/foo exists).
> > 
> > The problem is that when the tar on the right gets run, it 
> > tries to place
> > the files in the directory:
> >   /cygdrive/l/foo/j:/foobar
> > which of course isn't a valid directory.
> > 
> > I know I can solve it by not going over another filesystem, 
> > but that isn't
> > ideal.
> > 
> > Any ideas?  (I am running latest net release on W2K.  l: and 
> > j: are mapped
> > drives.  I also tried mounting them, didn't solve a thing. 
> > WinNT Ver 5.0
> > build 2195,
> > Cygwin DLL version i   dll major: 1001     dll minor: 4    
> > dll epoch: 19)
> 
> 
> Did you try "... | tar -C /cygdrive/j/foobar" ?
> 
> The problem here is that for TAR (except if especially 
> changed for cygwin) j:/foobar is a *relative* path name, not 
> an absolute one (it does not start by a '/') :-(
> 
> The cygwin /cygdrive feature is just for that :-)
> 

Just forgot to say, sending faster than thinking :-): you can use cygpath to
automatically convert to/from DOS paths so that you have no problems like
this one.

HTH

	Bernard

--------------------------------------------
Bernard Dautrevaux
Microprocess Ingenierie
97 bis, rue de Colombes
92400 COURBEVOIE
FRANCE
Tel:	+33 (0) 1 47 68 80 80
Fax:	+33 (0) 1 47 88 97 85
e-mail:	dautrevaux@microprocess.com
		b.dautrevaux@usa.net
-------------------------------------------- 

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* tar -C dir option makes dir relative to current dir
@ 2000-09-06  7:38 Jon Mountjoy
  0 siblings, 0 replies; 4+ messages in thread
From: Jon Mountjoy @ 2000-09-06  7:38 UTC (permalink / raw)
  To: cygwin

Hi All,

I have read all docs and couldn't solve my problem.  In a make file I have:
 cd foo && tar blah blah | tar -C j:/foobar

Now I run the make file from the l: drive (so l:/foo exists).

The problem is that when the tar on the right gets run, it tries to place
the files in the directory:
  /cygdrive/l/foo/j:/foobar
which of course isn't a valid directory.

I know I can solve it by not going over another filesystem, but that isn't
ideal.

Any ideas?  (I am running latest net release on W2K.  l: and j: are mapped
drives.  I also tried mounting them, didn't solve a thing. WinNT Ver 5.0
build 2195,
Cygwin DLL version i   dll major: 1001     dll minor: 4    dll epoch: 19)

Regards,
Jon


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2000-09-06  9:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-09-06  9:14 tar -C dir option makes dir relative to current dir Bernard Dautrevaux
  -- strict thread matches above, loose matches on Subject: below --
2000-09-06  9:43 Earnie Boyd
2000-09-06  9:16 Bernard Dautrevaux
2000-09-06  7:38 Jon Mountjoy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).