| Author |
FTP file copy problem with timestamp?
|
prem kanna
Greenhorn
Joined: Sep 10, 2008
Posts: 26
|
|
Hi,
Can any one tell me how to set file lastModifiedTime after copying files through FTP. I am using commons-net-1.4.1.jar to copy files from local system to server.
Eg: local file name “test.doc” (Today, December 29, 2009, 5:09:33 PM) when I moving this file to server, the files are moved successfully but the time is updated as server current time. But I need local file time like (Today, December 29, 2009, 5:09:33 PM). Below code I am using for uploading files to server.
Can any one please help me to overcome this issue?
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
I don't think the FTP protocol supports this. Any FTP program I've used so far simply sets the last modified date as "now".
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
fred rosenberger
lowercase baba
Bartender
Joined: Oct 02, 2003
Posts: 9950
|
|
|
you might be able to tar them up, ftp the tarball, then untar them on the destination machine. I think that would preserve the timestamps.
|
Never ascribe to malice that which can be adequately explained by stupidity.
|
 |
prem kanna
Greenhorn
Joined: Sep 10, 2008
Posts: 26
|
|
hi,
i didnt get any answer for my problem. can any one please give some Suggestion to solve my problem.
Thanks in advance.
|
 |
fred rosenberger
lowercase baba
Bartender
Joined: Oct 02, 2003
Posts: 9950
|
|
|
did you try what I suggested?
|
 |
 |
|
|
subject: FTP file copy problem with timestamp?
|
|
|