[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
TESTPUT w. var. for local path frequently returns "No such path or directory"
Hello everybody.
I think the FTPAPI looks like a fine piece of sottware.
-but having debugged my own version TESTPUTMJH, of TESTPUT, as well as
browsing the archives I have come to the of my wits.
TESTGET works great.
I get the fips.exe right on spot whenever I try.
TESTPUT, modified with hardcoded servername/user/password for our
remote server, puts always the fips.exe right on.
Got practically no experience with FTP nor coding RPG, so I started
with small ambitions:.
TESTPUTMJH, my version of TESTPUT (Please see code enclosed at end of
mail)
CL program TSPUTMJHCL (code also enclosed) for calling TESTPUTMJH and
not having to write the path for my local testfile all the time.
Whether I call TESTPUTMJH directly or indirectly by calling TSPUTMJHCL
I more often than not receive the error message "No such path or
directory.". When debugging with STRDBG it goes wrong here:
FTP_put
.
.
eval wwFD = OpnFile(wwLocal: 'R': p_read:
p_close: peSocket)
.
.
FYI wwFD contains -1 when it fails at my place.
Curiously to me the statement `eval wkTotBytes =
lclFileSiz(wwLocal)' just two lines above ALWAYS returns the filesize
correctly.
-but sometimes it all work.
When entering i5/OS Main Menu and CALL TSPUTMJHCL I most often get "No
such path or directory." and then it goes wrong no matter how many
times I try.
STRPDM, WRKSPLF or Entering STRISDB and leaving ISDB sometimes make it
execute correctly when called from a command line one of those places.
When debugging it looks to me as wwLocal, p-read, p_close and peSocket
always contains the same values before executing
eval wwFD = OpnFile(wwLocal: 'R': p_read:
p_close: peSocket)
The path supplied in wwLocal is NEVER enclosed in quotes nor
apostrophes.
I have seen it work with the path
ndisfiles/prod/society/063/S063376.zip
and also with this
/ndisfiles/prod/society/063/S063376.zip
- As well as failing with either.
So far I have not succeeded when submitting TSPUTMJHCL
Thanks for reading and wishing you all a great weekend.
Morten
CL code for TSPUTMJHCL:
PGM
/* CHDIR DIR(/) */
/* CHDIR DIR('NDISFILES/PROD/SOCIETY/063') */
DSPCURDIR
CALL PGM(LIBFTP/TESTPUTMJH) +
PARM('ndisfiles/prod/society/063/S063376.zi+
p')
ENDPGM
****************** End of data
****************************************
Code for TESTPUTMJH
0062.00
0063.00 H BNDDIR('FTPAPI') DFTACTGRP(*NO)
ACTGRP(*NEW)
0064.00
0065.00 /COPY QRPGLESRC,FTPAPI_H
0066.00
0067.00 D Msg S
52A
0068.00 D sess S 10I
0
0069.00 D Homedirfil S
256A
0072.00
0073.00 c *entry
plist
0074.00 c parm
Homedirfil
0075.00 * connect to FTP server. If an error
occurs,
0076.00 * display an error message and
exit.
0077.00 c eval sess = ftp_conn('X.X.X':
0078.00 c 'X':
0079.00 c 'X')
0080.00 c if sess <
0
0081.00 c eval Msg =
ftp_errorMsg(0)
0082.00 c dsply
Msg
0083.00 c eval *inlr =
*on
0084.00 c return
0085.00 c endif
0086.00
0087.00 * Change to the CRD_test directory on
0088.00 * this FTP server. Deal with any errors.
0089.00 c if ftp_chdir(sess: 'CRD_test') < 0
0090.00 c eval Msg = ftp_errorMsg(sess)
0091.00 c dsply Msg
0092.00 c dsply Msg
0093.00 c callp ftp_quit(sess)
0094.00 c eval *inlr = *on
0095.00 c return
0096.00 c endif
0097.00
0098.00
0099.00 * put the file specified in Homedirfil
0101.00 c callp ftp_binaryMode(sess: *on)
0102.00 c if ftp_put(sess: 'S063376.zip':
0103.00 c Homedirfil) < 0
0104.00 c eval Msg = ftp_errorMsg(sess)
0105.00 c dsply Msg
0106.00 c dsply Msg
0107.00 c dsply Msg
0108.00 c endif
0109.00
0110.00 c callp ftp_quit(sess)
0111.00 c eval *inlr = *on
0112.00 c return
Morten Ju Hansen
IT-udvikling
IT Development
____________________________________________
KODA
Landemærket 23-25
Postboks 2154
DK-1016 København K
T: +45 33 30 63 84
F: +45 33 30 63 30
mjh@xxxxxxx | [1]www.koda.dk
http://www.kodafiles.dk/emailgifs/kodagif.gif
____________________________________________
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
References
1. http://www.koda.dk/
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------