ZipFileMember>>contentStream has leading characters

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

ZipFileMember>>contentStream has leading characters

DiegoSanchez
Hi everybody!  This is my first post and I'm posting this question after going around this forum without finding answer for my question.  I couldn't wrap my mind around it.

Here is the issue (in fact it is not a issue, classes work fine).

I want to uncompress a zip file and file in the content of one of the file included in zip file.  For instance:
The file 'tp1.zip' contains just one file inside it: 'test.st'.

Once I uncompressed it, using code bellow:

doitFromStream
	| zipper file |
	zipper := ZipArchive new readFrom: '/Users/diego/tp1-95195.zip'.
	file := zipper members at: 2.
	
	"file contentStream returns the stream with file's information uncompressed"
 
I found that file stream has a set of leading characters which cannot be interpreted by CodeInterpreter.

Here you will fine these leading characters:

Hexa characters
ef  bb  bf
54  65  73  74  43  61  73  65  20  73  75  62  63

Ascii characters
ef  bb  bf
T   e   s   t   C   a   s   e  sp   s   u   b   c

Indeed, this leading characters are written by the fileOut process and it's ok (those are magic number which depend on the SO) but I don't know how to skip it for CodeInterpreter to be able fileIn this file.

My first solution was skipping this characters through the use of Stream>>next: 4. But I'm looking for a much portable solution.

Somebody went through this problem?

Thanks for help in advance.
DiegoS
Reply | Threaded
Open this post in threaded view
|

Re: ZipFileMember>>contentStream has leading characters

Tudor Girba-2
What is the code that you use?

Doru

On Mon, Oct 13, 2014 at 1:31 AM, DiegoSanchez <[hidden email]> wrote:
Hi everybody!  This is my first post and I'm posting this question after
going around this forum without finding answer for my question.  I couldn't
wrap my mind around it.

Here is the issue (in fact it is not a issue, classes work fine).

I want to uncompress a zip file and file in the content of one of the file
included in zip file.  For instance:
The file 'tp1.zip' contains just one file inside it: 'test.st'.

Once I uncompressed it, using code bellow:



I found that file stream has a set of leading characters which cannot be
interpreted by *CodeInterpreter*.

Here you will fine these leading characters:

/Hexa characters/
*ef  bb  bf *

/Ascii characters/
*ef  bb  bf *

Indeed, this leading characters are written by the fileOut process and it's
ok (those are magic number which depend on the SO) but I don't know how to
skip it for CodeInterpreter to be able fileIn this file.

My first solution was skipping this characters through the use of
/Stream>>next: 4/. But I'm looking for a much portable solution.

Somebody went through this problem?

Thanks for help in advance.
DiegoS



--
View this message in context: http://forum.world.st/ZipFileMember-contentStream-has-leading-characters-tp4784238.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.




--

"Every thing has its own flow"
Reply | Threaded
Open this post in threaded view
|

Re: ZipFileMember>>contentStream has leading characters

DiegoSanchez
doitFromStream
	| zipper file |
	zipper := ZipArchive new readFrom: '/Users/diego/tp1-95195.zip'.
	file := zipper members at: 2.
	
	"file contentStream returns the stream with file's information uncompressed"

On 13 October 2014 08:15, Tudor Girba <[hidden email]> wrote:
What is the code that you use?

Doru

On Mon, Oct 13, 2014 at 1:31 AM, DiegoSanchez <[hidden email]> wrote:
Hi everybody!  This is my first post and I'm posting this question after
going around this forum without finding answer for my question.  I couldn't
wrap my mind around it.

Here is the issue (in fact it is not a issue, classes work fine).

I want to uncompress a zip file and file in the content of one of the file
included in zip file.  For instance:
The file 'tp1.zip' contains just one file inside it: 'test.st'.

Once I uncompressed it, using code bellow:



I found that file stream has a set of leading characters which cannot be
interpreted by *CodeInterpreter*.

Here you will fine these leading characters:

/Hexa characters/
*ef  bb  bf *

/Ascii characters/
*ef  bb  bf *

Indeed, this leading characters are written by the fileOut process and it's
ok (those are magic number which depend on the SO) but I don't know how to
skip it for CodeInterpreter to be able fileIn this file.

My first solution was skipping this characters through the use of
/Stream>>next: 4/. But I'm looking for a much portable solution.

Somebody went through this problem?

Thanks for help in advance.
DiegoS



--
View this message in context: http://forum.world.st/ZipFileMember-contentStream-has-leading-characters-tp4784238.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.




--

"Every thing has its own flow"



--
Saludos
DiegoS

------


Reply | Threaded
Open this post in threaded view
|

Re: ZipFileMember>>contentStream has leading characters

DiegoSanchez
| zipper file |
	zipper := ZipArchive new readFrom: 'tp1.zip'.
        "file contains test.st"
	file := zipper members at: 1.
	
	"file contentStream returns the stream with file's information uncompressed"

On 13 October 2014 08:22, Diego Sánchez <[hidden email]> wrote:
doitFromStream
	| zipper file |
	zipper := ZipArchive new readFrom: '/Users/diego/tp1-95195.zip'.
	file := zipper members at: 2.
	
	"file contentStream returns the stream with file's information uncompressed"

On 13 October 2014 08:15, Tudor Girba <[hidden email]> wrote:
What is the code that you use?

Doru

On Mon, Oct 13, 2014 at 1:31 AM, DiegoSanchez <[hidden email]> wrote:
Hi everybody!  This is my first post and I'm posting this question after
going around this forum without finding answer for my question.  I couldn't
wrap my mind around it.

Here is the issue (in fact it is not a issue, classes work fine).

I want to uncompress a zip file and file in the content of one of the file
included in zip file.  For instance:
The file 'tp1.zip' contains just one file inside it: 'test.st'.

Once I uncompressed it, using code bellow:



I found that file stream has a set of leading characters which cannot be
interpreted by *CodeInterpreter*.

Here you will fine these leading characters:

/Hexa characters/
*ef  bb  bf *

/Ascii characters/
*ef  bb  bf *

Indeed, this leading characters are written by the fileOut process and it's
ok (those are magic number which depend on the SO) but I don't know how to
skip it for CodeInterpreter to be able fileIn this file.

My first solution was skipping this characters through the use of
/Stream>>next: 4/. But I'm looking for a much portable solution.

Somebody went through this problem?

Thanks for help in advance.
DiegoS



--
View this message in context: http://forum.world.st/ZipFileMember-contentStream-has-leading-characters-tp4784238.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.




--

"Every thing has its own flow"



--
Saludos
DiegoS

------





--
Saludos
DiegoS

------


Reply | Threaded
Open this post in threaded view
|

Re: ZipFileMember>>contentStream has leading characters

Tudor Girba-2
You are likely referring to the issue reported here:

This should work now in the latest Pharo 4.0. If you are using Pharo 3.0, loading the slice manually from the Pharo40Inbox should fix the issue as well.

What version are you using?

Cheers,
Doru



On Mon, Oct 13, 2014 at 1:23 PM, Diego Sánchez <[hidden email]> wrote:
| zipper file |
	zipper := ZipArchive new readFrom: 'tp1.zip'.
        "file contains test.st"
	file := zipper members at: 1.
	
	"file contentStream returns the stream with file's information uncompressed"

On 13 October 2014 08:22, Diego Sánchez <[hidden email]> wrote:
doitFromStream
	| zipper file |
	zipper := ZipArchive new readFrom: '/Users/diego/tp1-95195.zip'.
	file := zipper members at: 2.
	
	"file contentStream returns the stream with file's information uncompressed"

On 13 October 2014 08:15, Tudor Girba <[hidden email]> wrote:
What is the code that you use?

Doru

On Mon, Oct 13, 2014 at 1:31 AM, DiegoSanchez <[hidden email]> wrote:
Hi everybody!  This is my first post and I'm posting this question after
going around this forum without finding answer for my question.  I couldn't
wrap my mind around it.

Here is the issue (in fact it is not a issue, classes work fine).

I want to uncompress a zip file and file in the content of one of the file
included in zip file.  For instance:
The file 'tp1.zip' contains just one file inside it: 'test.st'.

Once I uncompressed it, using code bellow:



I found that file stream has a set of leading characters which cannot be
interpreted by *CodeInterpreter*.

Here you will fine these leading characters:

/Hexa characters/
*ef  bb  bf *

/Ascii characters/
*ef  bb  bf *

Indeed, this leading characters are written by the fileOut process and it's
ok (those are magic number which depend on the SO) but I don't know how to
skip it for CodeInterpreter to be able fileIn this file.

My first solution was skipping this characters through the use of
/Stream>>next: 4/. But I'm looking for a much portable solution.

Somebody went through this problem?

Thanks for help in advance.
DiegoS



--
View this message in context: http://forum.world.st/ZipFileMember-contentStream-has-leading-characters-tp4784238.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.




--

"Every thing has its own flow"



--
Saludos
DiegoS

------





--
Saludos
DiegoS

------





--

"Every thing has its own flow"
Reply | Threaded
Open this post in threaded view
|

Re: ZipFileMember>>contentStream has leading characters

DiegoSanchez
Thanks Tudor,

Yes I'm using Pharo 3. 

On 13 October 2014 08:33, Tudor Girba-2 [via Smalltalk] <[hidden email]> wrote:
You are likely referring to the issue reported here:

This should work now in the latest Pharo 4.0. If you are using Pharo 3.0, loading the slice manually from the Pharo40Inbox should fix the issue as well.

What version are you using?

Cheers,
Doru



On Mon, Oct 13, 2014 at 1:23 PM, Diego Sánchez <[hidden email]> wrote:
| zipper file |
	zipper := ZipArchive new readFrom: 'tp1.zip'.
        "file contains test.st"
	file := zipper members at: 1.
	
	"file contentStream returns the stream with file's information uncompressed"

On 13 October 2014 08:22, Diego Sánchez <[hidden email]> wrote:
doitFromStream
	| zipper file |
	zipper := ZipArchive new readFrom: '/Users/diego/tp1-95195.zip'.
	file := zipper members at: 2.
	
	"file contentStream returns the stream with file's information uncompressed"

On 13 October 2014 08:15, Tudor Girba <[hidden email]> wrote:
What is the code that you use?

Doru

On Mon, Oct 13, 2014 at 1:31 AM, DiegoSanchez <[hidden email]> wrote:
Hi everybody!  This is my first post and I'm posting this question after
going around this forum without finding answer for my question.  I couldn't
wrap my mind around it.

Here is the issue (in fact it is not a issue, classes work fine).

I want to uncompress a zip file and file in the content of one of the file
included in zip file.  For instance:
The file 'tp1.zip' contains just one file inside it: 'test.st'.

Once I uncompressed it, using code bellow:



I found that file stream has a set of leading characters which cannot be
interpreted by *CodeInterpreter*.

Here you will fine these leading characters:

/Hexa characters/
*ef  bb  bf *

/Ascii characters/
*ef  bb  bf *

Indeed, this leading characters are written by the fileOut process and it's
ok (those are magic number which depend on the SO) but I don't know how to
skip it for CodeInterpreter to be able fileIn this file.

My first solution was skipping this characters through the use of
/Stream>>next: 4/. But I'm looking for a much portable solution.

Somebody went through this problem?

Thanks for help in advance.
DiegoS



--
View this message in context: http://forum.world.st/ZipFileMember-contentStream-has-leading-characters-tp4784238.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.




--

"Every thing has its own flow"



--
Saludos
DiegoS

------





--
Saludos
DiegoS

------





--

"Every thing has its own flow"



If you reply to this email, your message will be added to the discussion below:
http://forum.world.st/ZipFileMember-contentStream-has-leading-characters-tp4784238p4784295.html
To unsubscribe from ZipFileMember>>contentStream has leading characters, click here.
NAML



--
Saludos
DiegoS

------


Reply | Threaded
Open this post in threaded view
|

Re: ZipFileMember>>contentStream has leading characters

stepharo
In reply to this post by DiegoSanchez

On 13/10/14 01:31, DiegoSanchez wrote:
> Hi everybody!  This is my first post

Welcome :)
In which image version are you?

> and I'm posting this question after
> going around this forum without finding answer for my question.  I couldn't
> wrap my mind around it.
>
> Here is the issue (in fact it is not a issue, classes work fine).
>
> I want to uncompress a zip file and file in the content of one of the file
> included in zip file.  For instance:
> The file 'tp1.zip' contains just one file inside it: 'test.st'.
>
> Once I uncompressed it, using code bellow:
>
>  
>
> I found that file stream has a set of leading characters which cannot be
> interpreted by *CodeInterpreter*.
>
> Here you will fine these leading characters:
>
> /Hexa characters/
> *ef  bb  bf *
>
> /Ascii characters/
> *ef  bb  bf *
>
> Indeed, this leading characters are written by the fileOut process and it's
> ok (those are magic number which depend on the SO) but I don't know how to
> skip it for CodeInterpreter to be able fileIn this file.
>
> My first solution was skipping this characters through the use of
> /Stream>>next: 4/. But I'm looking for a much portable solution.
>
> Somebody went through this problem?
>
> Thanks for help in advance.
> DiegoS
>
>
>
> --
> View this message in context: http://forum.world.st/ZipFileMember-contentStream-has-leading-characters-tp4784238.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>


Reply | Threaded
Open this post in threaded view
|

Re: ZipFileMember>>contentStream has leading characters

DiegoSanchez

On 14 October 2014 03:25, stepharo [via Smalltalk] <[hidden email]> wrote:

On 13/10/14 01:31, DiegoSanchez wrote:
> Hi everybody!  This is my first post

Welcome :)
In which image version are you?

> and I'm posting this question after
> going around this forum without finding answer for my question.  I couldn't
> wrap my mind around it.
>
> Here is the issue (in fact it is not a issue, classes work fine).
>
> I want to uncompress a zip file and file in the content of one of the file
> included in zip file.  For instance:
> The file 'tp1.zip' contains just one file inside it: 'test.st'.
>
> Once I uncompressed it, using code bellow:
>
>  
>
> I found that file stream has a set of leading characters which cannot be
> interpreted by *CodeInterpreter*.
>
> Here you will fine these leading characters:
>
> /Hexa characters/
> *ef  bb  bf *
>
> /Ascii characters/
> *ef  bb  bf *
>
> Indeed, this leading characters are written by the fileOut process and it's
> ok (those are magic number which depend on the SO) but I don't know how to
> skip it for CodeInterpreter to be able fileIn this file.
>
> My first solution was skipping this characters through the use of
> /Stream>>next: 4/. But I'm looking for a much portable solution.
>
> Somebody went through this problem?
>
> Thanks for help in advance.
> DiegoS
>
>
>
> --
> View this message in context: http://forum.world.st/ZipFileMember-contentStream-has-leading-characters-tp4784238.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>





If you reply to this email, your message will be added to the discussion below:
http://forum.world.st/ZipFileMember-contentStream-has-leading-characters-tp4784238p4784442.html
To unsubscribe from ZipFileMember>>contentStream has leading characters, click here.
NAML



--
Saludos
DiegoS

------


Reply | Threaded
Open this post in threaded view
|

Re: ZipFileMember>>contentStream has leading characters

Ben Coman
DiegoSanchez wrote:
> I'm using Pharo 3.0 image
> (http://files.pharo.org/image/30/Pharo-Image-3.0-latest.zip)

That link changes from day to day. Can you report...
World Menu > System > System Reporter > Image > Latest update.
-ben


>
> On 14 October 2014 03:25, stepharo [via Smalltalk] <[hidden email]
> </user/SendEmail.jtp?type=node&node=4784515&i=0>> wrote:
>
>
>     On 13/10/14 01:31, DiegoSanchez wrote:
>     >  Hi everybody!  This is my first post
>
>     Welcome :)
>     In which image version are you?
>
>     >  and I'm posting this question after
>     >  going around this forum without finding answer for my question.  I
>     couldn't
>     >  wrap my mind around it.
>     >
>     >  Here is the issue (in fact it is not a issue, classes work fine).
>     >
>     >  I want to uncompress a zip file and file in the content of one of
>     the file
>     >  included in zip file.  For instance:
>     >  The file 'tp1.zip' contains just one file inside it: 'test.st
>     <http://test.st>'.
>     >
>     >  Once I uncompressed it, using code bellow:
>     >
>     >  
>     >
>     >  I found that file stream has a set of leading characters which
>     cannot be
>      > interpreted by *CodeInterpreter*.
>     >
>     >  Here you will fine these leading characters:
>     >
>     >  /Hexa characters/
>     >  *ef  bb  bf *
>     >
>     >  /Ascii characters/
>     >  *ef  bb  bf *
>     >
>     >  Indeed, this leading characters are written by the fileOut process
>     and it's
>     >  ok (those are magic number which depend on the SO) but I don't
>     know how to
>     >  skip it for CodeInterpreter to be able fileIn this file.
>     >
>     >  My first solution was skipping this characters through the use of
>      > /Stream>>next: 4/. But I'm looking for a much portable solution.
>     >
>     >  Somebody went through this problem?
>     >
>     >  Thanks for help in advance.
>     >  DiegoS
>     >
>     >
>     >
>     >  --
>     >  View this message in context:
>     http://forum.world.st/ZipFileMember-contentStream-has-leading-characters-tp4784238.html
>     >  Sent from the Pharo Smalltalk Users mailing list archive at
>     Nabble.com.
>     >
>     >
>
>
>
>
>     ------------------------------------------------------------------------
>     If you reply to this email, your message will be added to the
>     discussion below:
>     http://forum.world.st/ZipFileMember-contentStream-has-leading-characters-tp4784238p4784442.html
>
>     To unsubscribe from ZipFileMember>>contentStream has leading
>     characters, click here.
>     NAML
>     <http://forum.world.st/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
>
>
>
>
> --
> Saludos
> DiegoS
>
> ------
>  
> Diego Sanchez
> http://about.me/sanchez.diego
>
> <http://about.me/sanchez.diego?promo=email_sig>
>  
>
>
>
>
> ------------------------------------------------------------------------
> View this message in context: Re: ZipFileMember>>contentStream has
> leading characters
> <http://forum.world.st/ZipFileMember-contentStream-has-leading-characters-tp4784238p4784515.html>
> Sent from the Pharo Smalltalk Users mailing list archive
> <http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html> at Nabble.com.