We would like to save the time date stamp of file created while doing the
As per the example ScpTo.java , I have tried doing scp -p -t <filename>
but it seems like it does not save the file creation time.
Can anybody please help me.
How to save the date time stamp of the file while doing the scp,
something similar to command line scp -p.
+-From: "vijaya natarajan" <vijayaln@...> --
|_Date: Tue, 11 Dec 2007 12:46:15 -0800 __________
|We would like to save the time date stamp of file created while doing the
|As per the example ScpTo.java , I have tried doing scp -p -t <filename>
|but it seems like it does not save the file creation time.
There does not exist the formal documentation for scp protocol
and I'm not interested in implementing such a protocol, frankly to say.
I have heard that recent proprietary ssh system has dropped scp protocol
support and their scp command will use the sftp protocol internally.
In fact, I have contributed code to Apache Ant to use sftp protocol in
scp task, which has been already included Ant 1.7
Anyway, try to insert following lines to ScpTo.java
before sending "C" command,
File file=new File(lfile);
command+=(file.lastModified()/1000); // Time of last modification
command+=" 0 ";
command+=(file.lastModified()/1000); // Time of last access
On scp protocol, we need to send "access time", but Java API(java.lang.File)
does not allow us to get such a value ;-<
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Get latest updates about Open Source Projects, Conferences and News.