Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs Date: Thu, 6 Feb 2003 11:59:46 -0500 (EST) From: Igor Pechtchanski Reply-To: cygwin AT cygwin DOT com To: cygwin AT cygwin DOT com cc: Jamshid Afshar Subject: Re: Best way to associate .tar.gz with "tar -xzf"? In-Reply-To: Message-ID: Importance: Normal MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Thu, 6 Feb 2003, Igor Pechtchanski wrote: > On Thu, 6 Feb 2003, Jamshid Afshar wrote: > > > On Windows XP, I created a .tar.gz file type under Folder Options=>File > > Types tab. I then set the "Opens with" to a one-line batch file > > wintargz.bat: > > > > FOR %%F IN (%1) DO pushd %%~pF && tar -xvzf %%~nxF > > > > This allows double-clicking on a foo.tar.gz file to automatically cause it > > to be uncompressed and untarred. FYI, it is necessary to cd to that > > directory and untar only the filename portion without the path, otherwise > > you get the error appended below. > > > > Just thought I would share this. Maybe somebody has a better way to > > associate cygwin utilities with the Windows explorer. > > > > --Jamshid > > > > W:\Downloads>tar -tzf W:\Downloads\privoxy-3.0.0-stable-src.tar.gz > > tar (child): Cannot execute remote shell: No such file or directory > > tar (child): W\:\\Downloads\\privoxy-3.0.0-stable-src.tar.gz: Cannot open: > > I/O error > > tar (child): Error is not recoverable: exiting now > > > > gzip: stdin: unexpected end of file > > tar: Child returned status 2 > > tar: Error exit delayed from previous errors > > Jamshid, > > This happens because "tar" doesn't understand Windows paths. Since you're > using extended syntax anyway, you could try > > FOR /F "usebackq delims=|" %%F IN (`cygpath -u %1`) DO pushd %%~pF && tar -xvzf %%~nxF > > Any other POSIX-illegal filename character can be used in place of "|". > Igor > P.S. This probably won't work on Windows 9x. Oops, cut-and-paste problem, sorry. The above line should read: FOR /F "usebackq delims=|" %%F IN (`cygpath -u %1`) DO tar -xvzf %%F I should re-read my messages before sending (now, where have I heard *that* before?). Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu ZZZzz /,`.-'`' -. ;-;;,_ igor AT watson DOT ibm DOT com |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! Oh, boy, virtual memory! Now I'm gonna make myself a really *big* RAMdisk! -- /usr/games/fortune -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/