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

Re: FTP Pulling Partial Files



Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>

1.  Connect from a remote iSeries system to our system (using FTPAPI).
2.  Submit a job on our system.
3.  Have the original FTPAPI session "wait" for our job to end.  We have
it look for a particular file that the submitted job creates when it is
done.  If not found, it delays for 10 seconds and tries again.  Repeats
until the file is created to tell the job to continue or until 10 times of
"looking" (in case something has happened to the submitted job).
4.  Once the file is found, then the original job pulls the files back to
do other processing on them.

Yikes! Why did you pick FTP for this? This sounds like an absolutely ideal candidate for HTTPAPI on the remote end, and CGIDEV2 on the "our server" end.


What seems to be happening is that we are only pulling back some of the
records from the remote side back to the "home" system.  I have a hard
time believing that somehow the file writes on our system are still in the
buffer or something and that when the FTP job wakes up and sees the "I'm
Done" file, that it is pulling back incomplete files.  But, obviously I do
not know the answer so at this point I am open to any suggestions or
theories.

No idea. I would guess that the program is creating the "I'm Done" file before it flushes all of the records to disk, but that's purely a guess and you've already said that you don't think it's the answer.


Is FTP_get() returning an error? If you look at the log/job log, is it sending you the proper response code when the file is received?

Do anyone have ideas on what may be happening, or even a better way to
handle what I am trying to do.

I'd suggest HTTP. HTTP always works as a request/response situation. You'd have the remote iSeries request a particular URL on the server that points to an RPG program. That program does whatever processing it needs to and returns the file straight out to the HTTP client. The HTTP client saves it to a file on disk or whatever you need.


HTTPAPI works nicely from the "remote computer" and CGIDEV2 may work nicely on the server machine (depending on what you're doing) to make it easy to return the document.
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------