Hi, +-From: "vijaya natarajan" <[EMAIL PROTECTED]> -- |_Date: Tue, 11 Dec 2007 12:46:15 -0800 __________ | |We would like to save the time date stamp of file created while doing the |copy. |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[1] 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="T"; command+=(file.lastModified()/1000); // Time of last modification command+=" 0 "; command+=(file.lastModified()/1000); // Time of last access command+=" 0"; command+="\n"; out.write(command.getBytes()); out.flush(); if(checkAck(in)!=0){ System.exit(0); } 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] http://tools.ietf.org/html/draft-ietf-secsh-filexfer-13 Sincerely, -- Atsuhiko Yamanaka JCraft,Inc. 1-14-20 HONCHO AOBA-KU, SENDAI, MIYAGI 980-0014 Japan. Tel +81-22-723-2150 +1-415-578-3454 Fax +81-22-224-8773 Skype callto://jcraft/ ------------------------------------------------------------------------- SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ JSch-users mailing list JSch-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jsch-users