Hi, I'm back.


>Well, I started the port after your first mail, but now I am 
>stuck in a trouble and running out of time.
>
>There remains "a problem with reading regular data and gzipped 
>data from the same filehandle" which was mentioned in Chris's 
>port. I followed with my debugger, but no good result.

I am using CW Pro5 IDE and the MSL library for porting and 
suspecting that this library is causing a trouble. Maybe this 
problem is diffrent from what Chris stated.

In my case, Zlib calls 'fdopen' and this function will be linked 
from MSL lib.  'fdopen' is supposed to be passed a valid refnum (
which is an int) used by the MacOS.
On the other hand, MacPerl is passing a diffrent number to '
fdopen' which seems to be following the UNIX convention. (I am 
not sure) In a particular case '4'


>Another problem is in gzreadline. It is described in the pod;
>
>At this time gzreadline ignores the variable $/ ($INPUT_RECORD_
>SEPARATOR or $RS when English is in use). The end of a line is 
>denoted by the C character '\n'. 
>
>and, It works like this in Chris's port, but not in my case. The 
>end of line has to be '\012' which is verry suffering on MacPerl.

This was easy, I forgot to check 'Map Newline to CR' which will 
convert newlines into MPW convention.


And, a new problem.

Zlib creats a new file always in the MacPerl folder.
On the contrary, the expected behavior is that, if the script is 
executed from a saved file, then the default directory (cwd) has 
to be the directory (folder) of the originating file, and a file 
without path would be created there.

I traced with my debugger and found out 'gzopen' calls 'fopen' 
which is again linkd from MSL, and inside 'fopen' called toolbox 
routine PBGetCatInfoSync and PBHOpenDFSync. These routines points 
the MacPerl folder as the default directory, if called without 
path specified.

So, to have files created in the expected place, either Zlib ('
gzopen') pass full path to 'fopen' or 'fopen' resolves full path 
regarding whether the script is saved on a file.

I guess that the later is expected in building XS, and thus MSL 
lib is not appropriate?  Am I correct?  If so, what lib is 
required?

Welcome any hint.


Hmmm, must figure it out and put it in the new tutorial.

or

forget about it and wait for the new 5.6.0 :-)


--
Takeshi

Reply via email to