[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: FTPAPI: using DIR to get a directory-list into a file
Hello Scott,
Thank you very much for your reply and your explanation. My problem is
the following:
We find today a directory on the server with the name xyz. It has
creation date April 12, 2014. Tomorrow it will be deleted and replaced
with a new directory xyz, with creation date April 23, 2014. If I only
have the names of the directories, I don't know, if the directory is
the same as it was yesterday. So I will have to download the content of
the directory and compare it with the content of the directory that I
downloaded last week.
It's not possible for me to rename or delete the directory after I have
downloaded the content.
The IBM client gives me the creation date.
As a work around I could use the IBM client to get the creation dates
and use this information to tell FTPAPI, which directories it has to
download.
Another possibility could be to try to convince the people, that place
the directories on the server to use unique names, for example by
placing a date (or timestamp) in front of the directory names:
20140422_directoryName. The directories are put on the server by a
manual process.
Best regards
Jan
Am 22.04.2014 15:55, schrieb Scott Klement:
Jan,
You are confusing FTPAPI with the IBM FTP client. FTPAPI does not
have the ability to write a directory listing to a file. If you wish
to have your directory contents in a file, then you may take the data
sent from FTPAPI (which comes as an array) and write it's contents to a
file from your RPG program.
On 4/22/2014 8:35 AM, Jan Grove Vejlstrup wrote:
Hello
I am using FTPAPI to get informations of a remote directory.
I use the command DIR. If I open an interactive session, it works
allright. The file DIROUTPUT is created in the current library.
I've written a little testprogram test305 using FTPAPI. If I run it I
find the following in the joblog, but no file DIROUTPUT in the current
library. Here is the joblog:
4 > call
test305
1-: FTPAPI version 3.0beta1 released on
2010-02-21
99-: Connecting to host xxxxxxxxxx.yy at address xxx.xxx.xxx.xxx
using port
21.
0: 220 Microsoft FTP
Service
0: > USER xxxxxxxxxxxx
0: 331 Password required for
xxxxxxxxxxxxxxx.
0: > PASS
**********
0: 230 User xxxxxxxxxxxx logged
in.
0: > DIR /Depot
(DISK
0: 500 'DIR /Depot (DISK': command not
understood
0: >
QUIT
0: 221
The little program comes here:
/free
*inlr = *on;
ftp_logging(0: *on);
ftp = ftp_conn(FTPADR: FTPUSER: FTPPWD);
if ftp < 0;
msg = FTP_errorMsg(0);
dsply msg;
return;
endif;
command = 'DIR /Depot (DISK';
returnValue = ftp_quote(ftp: command);
ftp_quit(ftp);
return;
/end-free
Why doesn't it work, when I use the program?
Best regards
Jan
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
[1][1]http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
References
1. [2]http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
[3]http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
References
1. http://www.scottklement.com/mailman/listinfo/ftpapi
2. http://www.scottklement.com/mailman/listinfo/ftpapi
3. 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
-----------------------------------------------------------------------