Extracting *.tar.gz file in Pharo 5

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Extracting *.tar.gz file in Pharo 5

Juraj Kubelka-5
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Extracting *.tar.gz file in Pharo 5

Tudor Girba-2
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 <[hidden email]> 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."


Reply | Threaded
Open this post in threaded view
|

Re: Extracting *.tar.gz file in Pharo 5

Juraj Kubelka-5
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Extracting *.tar.gz file in Pharo 5

Mariano Martinez Peck
Well, you could use OSProcess right? 

On Fri, Nov 20, 2015 at 5:16 PM, Juraj Kubelka <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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."
>
>





--
Reply | Threaded
Open this post in threaded view
|

Re: Extracting *.tar.gz file in Pharo 5

Juraj Kubelka-5
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Extracting *.tar.gz file in Pharo 5

Thierry Goubier
In reply to this post by Juraj Kubelka-5
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 <[hidden email]>
>> 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
>>> <[hidden email]> 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."
>>
>>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Extracting *.tar.gz file in Pharo 5

Juraj Kubelka-5
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Extracting *.tar.gz file in Pharo 5

Thierry Goubier
Le 20/11/2015 21:44, Juraj Kubelka a écrit :

>
>> On Nov 20, 2015, at 17:36, Thierry Goubier
>> <[hidden email]> 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
>

Reply | Threaded
Open this post in threaded view
|

Re: Extracting *.tar.gz file in Pharo 5

Stephan Eggermont-3
In reply to this post by Juraj Kubelka-5
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



Reply | Threaded
Open this post in threaded view
|

Re: Extracting *.tar.gz file in Pharo 5

stepharo
In reply to this post by Juraj Kubelka-5


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 <[hidden email]> 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 <[hidden email]> 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."
>>
>>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Extracting *.tar.gz file in Pharo 5

Ben Coman
In reply to this post by Juraj Kubelka-5
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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."
>>
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Extracting *.tar.gz file in Pharo 5

Tudor Girba-2
In reply to this post by stepharo
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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."