[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Preserve file date/time
Sender: "Goodbar, Loyd (ETS - Water Valley)" <LGoodbar@xxxxxxxxxxxxxx>
Thanks, Scott.
I'm querying a specific server (Windows 2000 FTP server) for data. I've
already worked out the utime API, I just didn't know how to pull in the
date/time from the remote file.
I understand your concerns about parsing a directory listing, it's the same
issue with parsing spooled output between various OS/400 releases. I'll try
the mtime approach first to see how that works.
Thanks,
Loyd
Loyd Goodbar
Senior programmer/analyst
BorgWarner
E/TS Water Valley
662-473-5713
-----Original Message-----
From: Scott Klement [mailto:sk@xxxxxxxxxxxxxxxx]
Sent: Friday, April 29, 2005 14:08
To: ftpapi@xxxxxxxxxxxxx
Subject: Re: Preserve file date/time
Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>
Hello,
> When retrieving data from a remote server to the iSeries, is it possible
> to preserve the file's date/time from the remote server? If a file is
> dated 08:00, can I retrieve it and have it remain 08:00 instead of 12:08
> when I retrieved it?
Sometimes. The FTP_mtime() API from FTPAPI can return the "date last
modified" from some FTP servers. (Not all of them support this, however.)
You can then use the utime() API (supplied with OS/400 V3R1 or later) to
set your file to match.
If you can't use FTP_mtime() you might be able to make it work using
FTP_dir() to get the directory listing and extract teh time from that
listing. However, I strongly recommend that you do not use this approach,
because there's no standard for the format of the data in the FTP_dir()
listing. Every server's information can be different, so you can
potentially end up with code that works with only particular FTP servers.
Good luck!
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------