[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AW: FTPAPI does not accept § in file names



Hi Scott,

I tried your advice but I get still the same error.
I found out by debugging where the error really occurs.
It's in the procedure 'fixpath' where the pathname is passed to the
procedure 'lstat64'. This procedure can obviously not handle the § sign and
returns an error message (see DEBUG snippets below).  

8517  *++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
8518  *  This fixes the pathname to a file so that it'll contain 
8519  *   full, true pathname (not a symlink or relative pathname
8520  *++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
8521 P fixpath         B                                         
8522 D fixpath         PI           256A                         
8523 D   pePath                     256A   const                 
8524 D   peObjType                   10A                         
8525 D   peCodePg                    10I 0                       

etc.

8541  ************************************************
8542   Resolve wwPath to a real link (not a symlink)  
8543    and get the statds for it                                        
8544  ************************************************                   
8545                    dou       wwSymlink = *Off                       
8546                                                                     
8547                    eval      wwSymLink = *Off                       
DEBUG: WWPATH = '/QSYS.LIB/GASS.LIB/QRPGLESRC.FILE/GR§AA00.MBR'
8548                    if        lstat64(%addr(wwPath): p_statds64) < 0 
8549                    callp     geterror(wwErrMsg)                     
DEBUG: WWERRMSG =  'No such path or directory.'
8550                    callp     SetError(FTP_LSTAT: wwErrMsg)          
8551                    leave                                            
8552                    endif                                            

I also tried to use the former 'lstat' procedure but there was no
difference.
Somewhere in an other code I have seen the use of EXTPROC('QLGLSTAT') for
the LSTAT operation. Do you know the difference? Would make it sense to
replace 'LSTAT64' by 'QLGLSTAT'? 

Kind regards,

Werner Noll
Gesellschaft für Individual-Software mbH
Ludwigstrasse 15
63739 Aschaffenburg
Germany
Geschäftsführer: Werner Noll, Bernd Schröder
HR Aschaffenburg HRB 6020
Phone: +49-6021-299880
Fax: +49-6021-299882
e-mail: werner.noll@xxxxxxxxx
-----Ursprüngliche Nachricht-----
Von: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
[mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] Im Auftrag von Scott Klement
Gesendet: Freitag, 10. September 2010 19:45
An: HTTPAPI and FTPAPI Projects
Betreff: Re: FTPAPI does not accept § in file names

Hi Werner,

My guess is that there's a problem in the ParsePath() routine in 
FTPAPIR4. I haven't looked at it in years, but now that I'm looking at 
it, I see that the CCSID in that routine is hard-coded to 37 -- I 
suspect that's the cause of your issue.

Honestly, I don't understand why it was written that way. (It's stupid 
code!)  Frustratingly, it's probably my fault.

Anyway, in the ParsePath subprocedure, you'll see this:

c                   eval      Qlg_Path_Name_T = *ALLx'00'
c                   eval      CCSID = 37
c                   eval      Country_ID = 'US'
c                   eval      Language_ID = 'ENU'

Please try commenting out those 3 last lines, so that it looks like this:

c                   eval      Qlg_Path_Name_T = *ALLx'00'
c***                eval      CCSID = 37
c***                eval      Country_ID = 'US'
c***                eval      Language_ID = 'ENU'

Please keep the *ALLx'00' line intact, as setting the CCSID, Country_Id 
and Language_Id fields to hex zeros should mean "use the job defaults", 
which is probably what we want.

Try recompiling FTPAPI and running your program again.  Does it work better?


On 9/10/2010 7:34 AM, Werner Noll (Gefis) wrote:
>
>     Hi all,
>
>
>     we use FTPAPI for transferring source files vom one system to another.
>
>     Now we have member names with an embedded § sign.
>
>     In this case the FTP_PUT procedure fails with error at the OpnFile:
>
>
>     open the file to send
>
>                      eval      wwFD = OpnFile(wwLocal: 'R': p_read:
>
>                                            p_close: peSocket)
>
>                      if        wwFD<  0
>
>                      return    -1
>
>                      endif
>
>
>     The pathname in wwLocal is:
>     /QSYS.LIB/GASS.LIB/QRPGLESRC.FILE/GR§AA00.MBR
>
>     The return value in wwFD is  -1.
>
>
>     The problem is surely caused by the § sign.
>
>
>     Is there any work around (except changing file names)?
>
>
>     Man thanks in advance.
>
>     Regards,
>
>
>     Werner Noll
>     Gesellschaft für Individual-Software mbH
>     Ludwigstrasse 15
>
>     63739 Aschaffenburg
>
>     Germany
>
>     Geschäftsführer: Werner Noll, Bernd Schröder
>
>     HR Aschaffenburg HRB 6020
>     Phone: +49-6021-299880
>     Fax: +49-6021-299882
>
>     e-mail: werner.noll@xxxxxxxxx
>
>
>
>
> -----------------------------------------------------------------------
> This is the FTPAPI mailing list.  To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> -----------------------------------------------------------------------

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------