All I really needed is the last modified date of the source file
(U_USMO_EEDATAFILE.txt in my example). Retaining the last modified date
of U_USMO_EEDATAFILE.txt file on the target file (/tmp/prpayin.txt) is
optional.
I'm only allow to use sftp on this particular download. Not sure if
Scott's FTP API will work on a sftp server. Will check it out.
Thanks
<lgoodbar@xxxxxxxxxxxxxx> wrote in message
news:<mailman.21603.1249583851.23468.midrange-l@xxxxxxxxxxxx>...
If U_USMO_EEDATAFILE.txt has a modified date of 1 Aug 2009, and after
downloading /tmp/prpayin.txt has a modified date of 6 Aug 2009; are you
asking if there is a way to change /tmp/prpayin.txt's modified date to 1
Aug 2009?
If so, consider using Scott Klement's FTP API. You can use the FTP_mtime
function to retrieve the source file's modified time, and use utime to
change the local file.
Note that the "other" FTP server must support mtime. It is not
universally supported.
We do this on nightly files received from a third party.
HTH,
Loyd
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Lim Hock-Chai
Sent: Thursday, August 06, 2009 1:16 PM
To: Midrange Systems Technical Discussion
Subject: sftp - how to retain the last modified date of downloading file
Is there a way to retain the last modified date of the file on the
server that I'm downloading from? Note: I'm using sftp thru OpenSSL.
Below is my sftp script:
cd /Exports
get U_USMO_EEDATAFILE.txt /tmp/prpayin.txt
exit
thanks
----------
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.