Extracting *.tar.gz file in Pharo 5
Hi, is there a way to extract *.tar.gz files using plain Pharo 5 image? Without loading extra packages? It could be OS dependent. Maybe calling external linux tar application. I have done it with ExternalUnixOSProcess object, but it is not standard part of Pharo 5. Thanks for any comment. Juraj
Why not use Zip files? There already exists direct support for that (hopefully it still works). Doru
On Nov 20, 2015, at 4:16 PM, Juraj Kubelka <Juraj.Kubelka@gmail.com> wrote:
Hi,
is there a way to extract *.tar.gz files using plain Pharo 5 image? Without loading extra packages? It could be OS dependent. Maybe calling external linux tar application. I have done it with ExternalUnixOSProcess object, but it is not standard part of Pharo 5.
Thanks for any comment. Juraj
-- www.tudorgirba.com "Innovation comes in the least expected form. That is, if it is expected, it already happened."
If I remember well, ZIP in Pharo supports only one file (one stream of data). There is no support for directories. At least, when I have intended it some time ago, I failed. I do not stand on using *.tar.gz, but I have not found better solution for my setup: Directory is compressed on Linux machine and should be extracted on any machine by using local tools. Do I miss some feature in Pharo? Cheers, Juraj
On Nov 20, 2015, at 12:35, Tudor Girba <tudor@tudorgirba.com> wrote:
Why not use Zip files? There already exists direct support for that (hopefully it still works).
Doru
On Nov 20, 2015, at 4:16 PM, Juraj Kubelka <Juraj.Kubelka@gmail.com> wrote:
Hi,
is there a way to extract *.tar.gz files using plain Pharo 5 image? Without loading extra packages? It could be OS dependent. Maybe calling external linux tar application. I have done it with ExternalUnixOSProcess object, but it is not standard part of Pharo 5.
Thanks for any comment. Juraj
-- www.tudorgirba.com
"Innovation comes in the least expected form. That is, if it is expected, it already happened."
Well, you could use OSProcess right? On Fri, Nov 20, 2015 at 5:16 PM, Juraj Kubelka <juraj.kubelka@gmail.com> wrote:
If I remember well, ZIP in Pharo supports only one file (one stream of data). There is no support for directories. At least, when I have intended it some time ago, I failed.
I do not stand on using *.tar.gz, but I have not found better solution for my setup: Directory is compressed on Linux machine and should be extracted on any machine by using local tools.
Do I miss some feature in Pharo?
Cheers, Juraj
On Nov 20, 2015, at 12:35, Tudor Girba <tudor@tudorgirba.com> wrote:
Why not use Zip files? There already exists direct support for that (hopefully it still works).
Doru
On Nov 20, 2015, at 4:16 PM, Juraj Kubelka <Juraj.Kubelka@gmail.com> wrote:
Hi,
is there a way to extract *.tar.gz files using plain Pharo 5 image? Without loading extra packages? It could be OS dependent. Maybe calling external linux tar application. I have done it with ExternalUnixOSProcess object, but it is not standard part of Pharo 5.
Thanks for any comment. Juraj
-- www.tudorgirba.com
"Innovation comes in the least expected form. That is, if it is expected, it already happened."
-- Mariano http://marianopeck.wordpress.com
On Nov 20, 2015, at 17:21, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
Well, you could use OSProcess right?
Yes, it was my first solution. But we need something based on Pharo 5 image. And OSProcess is not in Pharo 5, right? We do not want to load more packages into default Pharo 5. This is the reason why I am looking for another solution. Thanks. Juraj
On Fri, Nov 20, 2015 at 5:16 PM, Juraj Kubelka <juraj.kubelka@gmail.com <mailto:juraj.kubelka@gmail.com>> wrote: If I remember well, ZIP in Pharo supports only one file (one stream of data). There is no support for directories. At least, when I have intended it some time ago, I failed.
I do not stand on using *.tar.gz, but I have not found better solution for my setup: Directory is compressed on Linux machine and should be extracted on any machine by using local tools.
Do I miss some feature in Pharo?
Cheers, Juraj
On Nov 20, 2015, at 12:35, Tudor Girba <tudor@tudorgirba.com <mailto:tudor@tudorgirba.com>> wrote:
Why not use Zip files? There already exists direct support for that (hopefully it still works).
Doru
On Nov 20, 2015, at 4:16 PM, Juraj Kubelka <Juraj.Kubelka@gmail.com <mailto:Juraj.Kubelka@gmail.com>> wrote:
Hi,
is there a way to extract *.tar.gz files using plain Pharo 5 image? Without loading extra packages? It could be OS dependent. Maybe calling external linux tar application. I have done it with ExternalUnixOSProcess object, but it is not standard part of Pharo 5.
Thanks for any comment. Juraj
-- www.tudorgirba.com <http://www.tudorgirba.com/>
"Innovation comes in the least expected form. That is, if it is expected, it already happened."
-- Mariano http://marianopeck.wordpress.com <http://marianopeck.wordpress.com/>
Le 20/11/2015 21:16, Juraj Kubelka a écrit :
If I remember well, ZIP in Pharo supports only one file (one stream of data). There is no support for directories. At least, when I have intended it some time ago, I failed.
No, zip in Pharo works with directories. However I think the zip Filesystem doesn't work which means you have to manipulate the zip members with the zip API, not as a filesystem.
I do not stand on using *.tar.gz, but I have not found better solution for my setup: Directory is compressed on Linux machine and should be extracted on any machine by using local tools.
Do I miss some feature in Pharo?
I think you do ;) Thierry
Cheers, Juraj
On Nov 20, 2015, at 12:35, Tudor Girba <tudor@tudorgirba.com> wrote:
Why not use Zip files? There already exists direct support for that (hopefully it still works).
Doru
On Nov 20, 2015, at 4:16 PM, Juraj Kubelka <Juraj.Kubelka@gmail.com> wrote:
Hi,
is there a way to extract *.tar.gz files using plain Pharo 5 image? Without loading extra packages? It could be OS dependent. Maybe calling external linux tar application. I have done it with ExternalUnixOSProcess object, but it is not standard part of Pharo 5.
Thanks for any comment. Juraj
-- www.tudorgirba.com
"Innovation comes in the least expected form. That is, if it is expected, it already happened."
On Nov 20, 2015, at 17:36, Thierry Goubier <thierry.goubier@gmail.com> wrote:
Le 20/11/2015 21:16, Juraj Kubelka a écrit :
If I remember well, ZIP in Pharo supports only one file (one stream of data). There is no support for directories. At least, when I have intended it some time ago, I failed.
No, zip in Pharo works with directories. However I think the zip Filesystem doesn't work which means you have to manipulate the zip members with the zip API, not as a filesystem.
Can you give me an example? The file has about 30.000 files (compressed less then 50 MB). I am not sure if it is good idea to manage this inside of Pharo image.
I do not stand on using *.tar.gz, but I have not found better solution for my setup: Directory is compressed on Linux machine and should be extracted on any machine by using local tools.
Do I miss some feature in Pharo?
I think you do ;)
Better :-) Cheers, Juraj
Thierry
Cheers, Juraj
On Nov 20, 2015, at 12:35, Tudor Girba <tudor@tudorgirba.com> wrote:
Why not use Zip files? There already exists direct support for that (hopefully it still works).
Doru
On Nov 20, 2015, at 4:16 PM, Juraj Kubelka <Juraj.Kubelka@gmail.com> wrote:
Hi,
is there a way to extract *.tar.gz files using plain Pharo 5 image? Without loading extra packages? It could be OS dependent. Maybe calling external linux tar application. I have done it with ExternalUnixOSProcess object, but it is not standard part of Pharo 5.
Thanks for any comment. Juraj
-- www.tudorgirba.com
"Innovation comes in the least expected form. That is, if it is expected, it already happened."
Le 20/11/2015 21:44, Juraj Kubelka a écrit :
On Nov 20, 2015, at 17:36, Thierry Goubier <thierry.goubier@gmail.com> wrote:
Le 20/11/2015 21:16, Juraj Kubelka a écrit :
If I remember well, ZIP in Pharo supports only one file (one stream of data). There is no support for directories. At least, when I have intended it some time ago, I failed.
No, zip in Pharo works with directories. However I think the zip Filesystem doesn't work which means you have to manipulate the zip members with the zip API, not as a filesystem.
Can you give me an example? The file has about 30.000 files (compressed less then 50 MB). I am not sure if it is good idea to manage this inside of Pharo image.
The code you'll be using is the one Metacello uses for its github and bitbucket urls, so I think it should handle it. The Metacello example is just: extractRepositoryFrom: zipFile to: directory "unzip <zipFile> into <directory>" ZipArchive new readFrom: zipFile; extractAllTo: directory asFileReference. As simple as that. So testing will be easy. Note that MetacelloPlatform also has the OSProcess-based unzip as well ;)
I do not stand on using *.tar.gz, but I have not found better solution for my setup: Directory is compressed on Linux machine and should be extracted on any machine by using local tools.
Do I miss some feature in Pharo?
I think you do ;)
Better :-)
Tell us how it goes anyway ;) Thierry
Cheers, Juraj
On 20-11-15 21:44, Juraj Kubelka wrote:
Can you give me an example? The file has about 30.000 files (compressed less then 50 MB). I am not sure if it is good idea to manage this inside of Pharo image.
AFAIK file systems are much worse with very many small files. Minimum block size. Stephan
Le 20/11/15 21:16, Juraj Kubelka a écrit :
If I remember well, ZIP in Pharo supports only one file (one stream of data). There is no support for directories. At least, when I have intended it some time ago, I failed.
mcz is a zip and it contain multifiles.
I do not stand on using *.tar.gz, but I have not found better solution for my setup: Directory is compressed on Linux machine and should be extracted on any machine by using local tools.
Do I miss some feature in Pharo?
Cheers, Juraj
On Nov 20, 2015, at 12:35, Tudor Girba <tudor@tudorgirba.com> wrote:
Why not use Zip files? There already exists direct support for that (hopefully it still works).
Doru
On Nov 20, 2015, at 4:16 PM, Juraj Kubelka <Juraj.Kubelka@gmail.com> wrote:
Hi,
is there a way to extract *.tar.gz files using plain Pharo 5 image? Without loading extra packages? It could be OS dependent. Maybe calling external linux tar application. I have done it with ExternalUnixOSProcess object, but it is not standard part of Pharo 5.
Thanks for any comment. Juraj -- www.tudorgirba.com
"Innovation comes in the least expected form. That is, if it is expected, it already happened."
Indeed. The GTInspector and Spotter shows you how to navigate inside such zip files, too :). Doru
On Nov 21, 2015, at 12:17 PM, stepharo <stepharo@free.fr> wrote:
Le 20/11/15 21:16, Juraj Kubelka a écrit :
If I remember well, ZIP in Pharo supports only one file (one stream of data). There is no support for directories. At least, when I have intended it some time ago, I failed.
mcz is a zip and it contain multifiles.
I do not stand on using *.tar.gz, but I have not found better solution for my setup: Directory is compressed on Linux machine and should be extracted on any machine by using local tools.
Do I miss some feature in Pharo?
Cheers, Juraj
On Nov 20, 2015, at 12:35, Tudor Girba <tudor@tudorgirba.com> wrote:
Why not use Zip files? There already exists direct support for that (hopefully it still works).
Doru
On Nov 20, 2015, at 4:16 PM, Juraj Kubelka <Juraj.Kubelka@gmail.com> wrote:
Hi,
is there a way to extract *.tar.gz files using plain Pharo 5 image? Without loading extra packages? It could be OS dependent. Maybe calling external linux tar application. I have done it with ExternalUnixOSProcess object, but it is not standard part of Pharo 5.
Thanks for any comment. Juraj -- www.tudorgirba.com
"Innovation comes in the least expected form. That is, if it is expected, it already happened."
-- www.tudorgirba.com "If you can't say why something is relevant, it probably isn't."
Monticello MCZ files are zip files. Just rename the extension to ZIP and unzip it and you'll see multiple files and a directory containing a file. So intuitively I'd say ZIP in Pharo must support directories - not that I know how :) cheers -ben On Sat, Nov 21, 2015 at 4:16 AM, Juraj Kubelka <juraj.kubelka@gmail.com> wrote:
If I remember well, ZIP in Pharo supports only one file (one stream of data). There is no support for directories. At least, when I have intended it some time ago, I failed.
I do not stand on using *.tar.gz, but I have not found better solution for my setup: Directory is compressed on Linux machine and should be extracted on any machine by using local tools.
Do I miss some feature in Pharo?
Cheers, Juraj
On Nov 20, 2015, at 12:35, Tudor Girba <tudor@tudorgirba.com> wrote:
Why not use Zip files? There already exists direct support for that (hopefully it still works).
Doru
On Nov 20, 2015, at 4:16 PM, Juraj Kubelka <Juraj.Kubelka@gmail.com> wrote:
Hi,
is there a way to extract *.tar.gz files using plain Pharo 5 image? Without loading extra packages? It could be OS dependent. Maybe calling external linux tar application. I have done it with ExternalUnixOSProcess object, but it is not standard part of Pharo 5.
Thanks for any comment. Juraj
-- www.tudorgirba.com
"Innovation comes in the least expected form. That is, if it is expected, it already happened."
participants (7)
-
Ben Coman -
Juraj Kubelka -
Mariano Martinez Peck -
Stephan Eggermont -
stepharo -
Thierry Goubier -
Tudor Girba