all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* non-interactive extracting the contents of a tar-file
@ 2005-06-27 10:23 Klaus Berndl
  2005-06-27 10:51 ` Peter Dyballa
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Klaus Berndl @ 2005-06-27 10:23 UTC (permalink / raw



I know tar-mode and it displays a dired-like listing of the contents.
So the user can mark entries and extrakt them to a buffer...

What i want is the following:
Is it possible with tar-mode (or other already existing elisp-code), to
extract the full contents of a tar-file to a certain directory (or at least to
default-directory)?

Ciao,
Klaus

-- 
Klaus Berndl			mailto: klaus.berndl@sdm.de
sd&m AG				http://www.sdm.de
software design & management	
Carl-Wery-Str. 42, 81739 Muenchen, Germany
Tel +49 89 63812-392, Fax -220

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

* Re: non-interactive extracting the contents of a tar-file
  2005-06-27 10:23 non-interactive extracting the contents of a tar-file Klaus Berndl
@ 2005-06-27 10:51 ` Peter Dyballa
  2005-06-27 19:30 ` J. Alejandro Noli
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 13+ messages in thread
From: Peter Dyballa @ 2005-06-27 10:51 UTC (permalink / raw
  Cc: help-gnu-emacs


Am 27.06.2005 um 12:23 schrieb Klaus Berndl:

> Is it possible with tar-mode (or other already existing elisp-code), to
> extract the full contents of a tar-file to a certain directory (or at 
> least to
> default-directory)?

There is an easier work-around in Emacs shell:

cd <some directory>
tar xf <some tar file>

--
Mit friedvollen Grüßen

   Pete

Either this man is dead or my watch has stopped. - Groucho Marx

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

* Re: non-interactive extracting the contents of a tar-file
       [not found] ` <mailman.1302.1119869779.2857.help-gnu-emacs@gnu.org>
@ 2005-06-27 11:11   ` Klaus Berndl
  2005-06-27 11:33     ` Peter Dyballa
  2005-06-28  8:16     ` Tim X
  2005-06-28  8:12   ` Tim X
  1 sibling, 2 replies; 13+ messages in thread
From: Klaus Berndl @ 2005-06-27 11:11 UTC (permalink / raw


On Mon, 27 Jun 2005, Peter Dyballa wrote:
>  
>  Am 27.06.2005 um 12:23 schrieb Klaus Berndl:
>  
> > Is it possible with tar-mode (or other already existing elisp-code), to
> > extract the full contents of a tar-file to a certain directory (or
> > at least to
> > default-directory)?
>  
>  There is an easier work-around in Emacs shell:
>  
>  cd <some directory>
>  tar xf <some tar file>

Hmm, i forgot to mention that i want it do without external programs like
tar and gz!

Ciao,
Klaus

-- 
Klaus Berndl			mailto: klaus.berndl@sdm.de
sd&m AG				http://www.sdm.de
software design & management	
Carl-Wery-Str. 42, 81739 Muenchen, Germany
Tel +49 89 63812-392, Fax -220

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

* Re: non-interactive extracting the contents of a tar-file
  2005-06-27 11:11   ` Klaus Berndl
@ 2005-06-27 11:33     ` Peter Dyballa
  2005-06-28  8:16     ` Tim X
  1 sibling, 0 replies; 13+ messages in thread
From: Peter Dyballa @ 2005-06-27 11:33 UTC (permalink / raw
  Cc: help-gnu-emacs


Am 27.06.2005 um 13:11 schrieb Klaus Berndl:

> Hmm, i forgot to mention that i want it do without external programs 
> like
> tar and gz!
>

I don't believe this could work. GNU Emacs needs external programmes 
like bzip2, gunzip, etc. to unpack the contents from a compressed file.

You can proof that yourself: rename the decompressors and try to open a 
compressed tar file!

--
Mit friedvollen Grüßen

   Pete

Got Mole problems?
Call Avogadro 6.02 x 10^23

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

* RE: non-interactive extracting the contents of a tar-file
@ 2005-06-27 11:47 klaus.berndl
  0 siblings, 0 replies; 13+ messages in thread
From: klaus.berndl @ 2005-06-27 11:47 UTC (permalink / raw
  Cc: help-gnu-emacs

Peter_Dyballa@Web.DE wrote:
> Am 27.06.2005 um 13:11 schrieb Klaus Berndl:
> 
>> Hmm, i forgot to mention that i want it do without external programs
>> like tar and gz!
>> 
> 
> I don't believe this could work. GNU Emacs needs external programmes
> like bzip2, gunzip, etc. to unpack the contents from a compressed
> file. 
> 
> You can proof that yourself: rename the decompressors and try to open
> a compressed tar file!

Hmm, yes, indeed, seems to be right... The emulation of tar in tar-mode.el
leads me to the (wrong) assumption that this is also possible for *.gz files....
Appaerently a wrong assumption ;-)

Ciao,
Klaus

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

* Re: non-interactive extracting the contents of a tar-file
  2005-06-27 10:23 non-interactive extracting the contents of a tar-file Klaus Berndl
  2005-06-27 10:51 ` Peter Dyballa
@ 2005-06-27 19:30 ` J. Alejandro Noli
  2005-06-28  7:18 ` Stefan Monnier
       [not found] ` <mailman.1302.1119869779.2857.help-gnu-emacs@gnu.org>
  3 siblings, 0 replies; 13+ messages in thread
From: J. Alejandro Noli @ 2005-06-27 19:30 UTC (permalink / raw


Klaus Berndl <klaus.berndl@sdm.de> writes:

> I know tar-mode and it displays a dired-like listing of the contents.
> So the user can mark entries and extrakt them to a buffer...
>
> What i want is the following:
> Is it possible with tar-mode (or other already existing elisp-code), to
> extract the full contents of a tar-file to a certain directory (or at least to
> default-directory)?

Have you seen emacs-goodies-el ?

there you have M-x browse-huge-tar-file, and it can work on a gziped one.
>
> Ciao,
> Klaus
>
> -- 
> Klaus Berndl			mailto: klaus.berndl@sdm.de
> sd&m AG				http://www.sdm.de
> software design & management	
> Carl-Wery-Str. 42, 81739 Muenchen, Germany
> Tel +49 89 63812-392, Fax -220

-- 
Saludos, 


- J. Alejandro Noli -
~~~~~~~~~~~~~~~~~~~~~

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

* Re: non-interactive extracting the contents of a tar-file
  2005-06-27 10:23 non-interactive extracting the contents of a tar-file Klaus Berndl
  2005-06-27 10:51 ` Peter Dyballa
  2005-06-27 19:30 ` J. Alejandro Noli
@ 2005-06-28  7:18 ` Stefan Monnier
  2005-06-28  8:39   ` Klaus Berndl
       [not found] ` <mailman.1302.1119869779.2857.help-gnu-emacs@gnu.org>
  3 siblings, 1 reply; 13+ messages in thread
From: Stefan Monnier @ 2005-06-28  7:18 UTC (permalink / raw


> Is it possible with tar-mode (or other already existing elisp-code), to
> extract the full contents of a tar-file to a certain directory (or at least to
> default-directory)?

The gunzipping needs to be done by an external program, but the untarring
can be performed by Emacs itself.  See install.el for an example of how you
can do that using tar-untar-buffer.  It's pretty untested code, tho.


        Stefan

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

* Re: non-interactive extracting the contents of a tar-file
       [not found] ` <mailman.1302.1119869779.2857.help-gnu-emacs@gnu.org>
  2005-06-27 11:11   ` Klaus Berndl
@ 2005-06-28  8:12   ` Tim X
  1 sibling, 0 replies; 13+ messages in thread
From: Tim X @ 2005-06-28  8:12 UTC (permalink / raw


Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> Am 27.06.2005 um 12:23 schrieb Klaus Berndl:
> 
> > Is it possible with tar-mode (or other already existing elisp-code), to
> > extract the full contents of a tar-file to a certain directory (or
> > at least to
> > default-directory)?
> 
> There is an easier work-around in Emacs shell:
> 
> cd <some directory>
> tar xf <some tar file>
> 
> --
> Mit friedvollen Grüßen
> 
>    Pete
> 
> Either this man is dead or my watch has stopped. - Groucho Marx
> 
Or from dired, hit !

,----[ C-h f dired-do-shell-command RET ]
| dired-do-shell-command is an interactive compiled Lisp function in `dired-aux'.
| (dired-do-shell-command COMMAND &optional ARG FILE-LIST)
| 
| Run a shell command COMMAND on the marked files.
| If no files are marked or a specific numeric prefix arg is given,
| the next ARG files are used.  Just C-u means the current file.
| The prompt mentions the file(s) or the marker, as appropriate.
| 
| If there is output, it goes to a separate buffer.
| 
| Normally the command is run on each file individually.
| However, if there is a `*' in the command then it is run
| just once with the entire file list substituted there.
| 
| If there is no `*', but a `?' in the command then it is still run
| on each file individually but with the filename substituted there
| instead of at the end of the command.
| 
| No automatic redisplay of dired buffers is attempted, as there's no
| telling what files the command may have changed.  Type
| M-x dired-do-redisplay to redisplay the marked files.
| 
| The shell command has the top level directory as working directory, so
| output files usually are created there instead of in a subdir.
| 
| In a noninteractive call (from Lisp code), you must specify
| the list of file names explicitly with the FILE-LIST argument.
`----

Tim

-- 
Tim Cross
The e-mail address on this message is FALSE (obviously!). My real e-mail is
to a company in Australia called rapttech and my login is tcross - if you 
really need to send mail, you should be able to work it out!

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

* Re: non-interactive extracting the contents of a tar-file
  2005-06-27 11:11   ` Klaus Berndl
  2005-06-27 11:33     ` Peter Dyballa
@ 2005-06-28  8:16     ` Tim X
  2005-06-28  8:42       ` Klaus Berndl
  2005-06-28  9:36       ` Peter Dyballa
  1 sibling, 2 replies; 13+ messages in thread
From: Tim X @ 2005-06-28  8:16 UTC (permalink / raw


Klaus Berndl <klaus.berndl@sdm.de> writes:

> On Mon, 27 Jun 2005, Peter Dyballa wrote:
> >  
> >  Am 27.06.2005 um 12:23 schrieb Klaus Berndl:
> >  
> > > Is it possible with tar-mode (or other already existing elisp-code), to
> > > extract the full contents of a tar-file to a certain directory (or
> > > at least to
> > > default-directory)?
> >  
> >  There is an easier work-around in Emacs shell:
> >  
> >  cd <some directory>
> >  tar xf <some tar file>
> 
> Hmm, i forgot to mention that i want it do without external programs like
> tar and gz!
> 
But doesn't emacs tar-mode just use tar 'under the hood'?

It may be possible to work out how to extract files from a tar archive
reasonably easily, but the unzipping/decompressing is going to be
difficult/impossible. Also, keep in mind that as GNU tar also supports
bzip2 compression, we are likely to see archive.tar.bz2 as well as
archive.tar.gz more often. 

Why the need not to use the correct tools? Is it because of platforms
which may not have tar or tar and gunzip equivelants and if so, what
platforms?

Tim


-- 
Tim Cross
The e-mail address on this message is FALSE (obviously!). My real e-mail is
to a company in Australia called rapttech and my login is tcross - if you 
really need to send mail, you should be able to work it out!

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

* Re: non-interactive extracting the contents of a tar-file
  2005-06-28  7:18 ` Stefan Monnier
@ 2005-06-28  8:39   ` Klaus Berndl
  2005-06-28 17:02     ` Edward O'Connor
  0 siblings, 1 reply; 13+ messages in thread
From: Klaus Berndl @ 2005-06-28  8:39 UTC (permalink / raw


On Tue, 28 Jun 2005, Stefan Monnier wrote:

> > Is it possible with tar-mode (or other already existing elisp-code), to
> > extract the full contents of a tar-file to a certain directory (or at
> > least to default-directory)?
>  
>  The gunzipping needs to be done by an external program, but the untarring
>  can be performed by Emacs itself.  See install.el for an example of how you
>  can do that using tar-untar-buffer.  It's pretty untested code, tho.

Thanks for the hint - where can i get install.el??

Ciao,
Klaus

>  
>  
>          Stefan

-- 
Klaus Berndl			mailto: klaus.berndl@sdm.de
sd&m AG				http://www.sdm.de
software design & management	
Carl-Wery-Str. 42, 81739 Muenchen, Germany
Tel +49 89 63812-392, Fax -220

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

* Re: non-interactive extracting the contents of a tar-file
  2005-06-28  8:16     ` Tim X
@ 2005-06-28  8:42       ` Klaus Berndl
  2005-06-28  9:36       ` Peter Dyballa
  1 sibling, 0 replies; 13+ messages in thread
From: Klaus Berndl @ 2005-06-28  8:42 UTC (permalink / raw


On 28 Jun 2005, Tim X. wrote:

>  Klaus Berndl <klaus.berndl@sdm.de> writes:
>  
> > On Mon, 27 Jun 2005, Peter Dyballa wrote:
> > >  
> > >  Am 27.06.2005 um 12:23 schrieb Klaus Berndl:
> > >  
> > > > Is it possible with tar-mode (or other already existing elisp-code),
> > > > to extract the full contents of a tar-file to a certain directory (or
> > > > at least to default-directory)?
> > >  
> > >  There is an easier work-around in Emacs shell:
> > >  
> > >  cd <some directory>
> > >  tar xf <some tar file>
> > 
> > Hmm, i forgot to mention that i want it do without external programs like
> > tar and gz!
> > 
>  But doesn't emacs tar-mode just use tar 'under the hood'?

No, untarring is done via elisp - see tar-mode.el

>  
>  It may be possible to work out how to extract files from a tar archive
>  reasonably easily, but the unzipping/decompressing is going to be
>  difficult/impossible. Also, keep in mind that as GNU tar also supports
>  bzip2 compression, we are likely to see archive.tar.bz2 as well as
>  archive.tar.gz more often.

yes, good point!

>  
>  Why the need not to use the correct tools? Is it because of platforms
>  which may not have tar or tar and gunzip equivelants and if so, what
>  platforms?

I had the wish to do it completely from within Emacs for my package so the
user has no need for installing stuff like tar or gzip (especially in
Windows-envs) - but the latter one is impossible, i see it now...

Klaus


>  
>  Tim

-- 
Klaus Berndl			mailto: klaus.berndl@sdm.de
sd&m AG				http://www.sdm.de
software design & management	
Carl-Wery-Str. 42, 81739 Muenchen, Germany
Tel +49 89 63812-392, Fax -220

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

* Re: non-interactive extracting the contents of a tar-file
  2005-06-28  8:16     ` Tim X
  2005-06-28  8:42       ` Klaus Berndl
@ 2005-06-28  9:36       ` Peter Dyballa
  1 sibling, 0 replies; 13+ messages in thread
From: Peter Dyballa @ 2005-06-28  9:36 UTC (permalink / raw
  Cc: help-gnu-emacs


Am 28.06.2005 um 10:16 schrieb Tim X:

> But doesn't emacs tar-mode just use tar 'under the hood'?
>

No. AFAIK Jamie Zawinsky wrote a native 'interpreter' for Tape ARchive 
files. It scans the structures, sees when a file or directory starts 
and ends, sees times and permissions ...

There is no such mechanism to un-compress (LHarc, arc, zip, gzip, UNIX 
compress, bzip2, Windows RAR and CABinet and PKzip, Mac OS Stuff and 
much older stuff, ...)

--
Greetings

   Pete

“One cannot live by television, video games, top ten CDs, and dumb 
movies alone”
       (Amiri Baraka 1999)

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

* Re: non-interactive extracting the contents of a tar-file
  2005-06-28  8:39   ` Klaus Berndl
@ 2005-06-28 17:02     ` Edward O'Connor
  0 siblings, 0 replies; 13+ messages in thread
From: Edward O'Connor @ 2005-06-28 17:02 UTC (permalink / raw


> Thanks for the hint - where can i get install.el??

         http://www.iro.umontreal.ca/~monnier/elisp/install.el


Ted

-- 
Edward O'Connor
hober0@gmail.com

Ense petit placidam sub libertate quietem.

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

end of thread, other threads:[~2005-06-28 17:02 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-27 10:23 non-interactive extracting the contents of a tar-file Klaus Berndl
2005-06-27 10:51 ` Peter Dyballa
2005-06-27 19:30 ` J. Alejandro Noli
2005-06-28  7:18 ` Stefan Monnier
2005-06-28  8:39   ` Klaus Berndl
2005-06-28 17:02     ` Edward O'Connor
     [not found] ` <mailman.1302.1119869779.2857.help-gnu-emacs@gnu.org>
2005-06-27 11:11   ` Klaus Berndl
2005-06-27 11:33     ` Peter Dyballa
2005-06-28  8:16     ` Tim X
2005-06-28  8:42       ` Klaus Berndl
2005-06-28  9:36       ` Peter Dyballa
2005-06-28  8:12   ` Tim X
  -- strict thread matches above, loose matches on Subject: below --
2005-06-27 11:47 klaus.berndl

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.