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

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
-----------------------------------------------------------------------