When copying via FTP, the date is set to "today"

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Bebosher
Junior Member
Junior Member
Posts: 7
Joined: 2017-03-01, 12:27 UTC

When copying via FTP, the date is set to "today"

Post by *Bebosher »

Hi everyone,

when copying via FTP, all files get the current date. That should be able to switch off as synonymous with copying via F5.
A Bug?

Micha
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Bebosher,
A Bug?
An option.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

For FTP also the copy direction matters. Downloading a file from FTP and keeping the date is an option alright. There's also a setting (in wcx_ftp.ini) to make it checked by default:
TC help, section 4.b) wrote:[default]
PreserveDates=0/1
Preserve file date/time on downloads
However, uploading a file to FTP requires the server to support setting the timestamp of the file. It it doesn't support it, the file will get the current date/time. And there's nothing you can do about that, unless you're the administrator of the FTP server software.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Bebosher
Junior Member
Junior Member
Posts: 7
Joined: 2017-03-01, 12:27 UTC

Post by *Bebosher »

Dalai wrote:...unless you're the administrator of the FTP server software.
Yes, I am. It's my Synology disc station.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

TC looks in the reply to the FEAT (and HELP SITE) commands whether the server supports one of the commands to send the time stamp:
MDTM, MFMT or SITE UTIME.

If your server supports one of these but does NOT report it, you can tell TC to use them anyway. You need to add one of the following values to wcx_ftp.ini, in the section of your connection:

SpecialFlags=4096
SpecialFlags=8192
SpecialFlags=12288

The first is for MDTM, the second for MFMT, and the last for SITE UTIME.

You will get an error if you set one of them but the server doesn't actually support the command.
Author of Total Commander
https://www.ghisler.com
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

Well, you should check whether any the commands used to set a timestamp is supported by your FTP server. You can see possible commands e.g. on this page. Take a look at the FTP log in TC (double click on the two lines of text shown above the panels while connected via FTP).

If your server doesn't announce support for any of these commands, you could take a look into the FTP server's settings; maybe it has an option that has something to do with setting timestamps of files. If you can't find anything, try searching for the FTP server name and any of the commands, e.g. "<synology-ftp-server-name> ftp mdtm" or something. There's also an old thread on the Synology forum, which doesn't look like you should keep your hopes up. I guess you should think about transferring files in a different way if timestamps are important...

[EDIT] Man, I'm slow today, but I'll leave the post as it is anyway. [/EDIT]

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Bebosher
Junior Member
Junior Member
Posts: 7
Joined: 2017-03-01, 12:27 UTC

Post by *Bebosher »

Thanks to all. That was a very constructive thread.
krapet
Junior Member
Junior Member
Posts: 21
Joined: 2007-08-02, 06:39 UTC
Location: Czech

Re: When copying via FTP, the date is set to "today"

Post by *krapet »

Christian, could you think about modify window - FTP: connection details ?

More user friendly is to choose method of time synchronization witch selection of: NONE, MDTM, MFMT or SITE UTIME
instead of modifying ini file with:
SpecialFlags=4096
SpecialFlags=8192
SpecialFlags=12288
Or even better is to implement all ways referred by Dalai in previous post.

Another issue relates to remote servers.
For its which don't use UTC it is necesary to corrects it.
Very useful can be possibility to use "Outgoing time shift" and "Incoming time shift" for file timestamps.
And also to have check box "Daylight saving".

Now the TC set timestamp always in UTC.
When server uses time zone -1:00 (or more) there it is not so big issue as when uses time zone +1:00 (or more).
In first case the time is "only" shifted.
In second case it is worse. The first 60 minutes (or multiples of hours) the server reports timestamp without time (only date is present) and TC show time 0:00. This is totally bad.

It can be nice to have button to "Autocheck time shift" which will to try to set way of timestamp method automatically.

I also found that checkbox SSL/TLS may not be sufficient. Some servers distinguish between implicit and explicit methods.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: When copying via FTP, the date is set to "today"

Post by *ghisler(Author) »

More user friendly is to choose method of time synchronization witch selection of: NONE, MDTM, MFMT or SITE UTIME
instead of modifying ini file
Normally this isn't necessary because well written FTP servers report in the reply to the FEAT command when they support these commands.
Another issue relates to remote servers.
For its which don't use UTC it is necesary to corrects it.
Very useful can be possibility to use "Outgoing time shift" and "Incoming time shift" for file timestamps.
Currently this is only in the sync tool. Modern servers support the MLSD (machine list directory) command, which uses UTC by definition.
I also found that checkbox SSL/TLS may not be sufficient. Some servers distinguish between implicit and explicit methods.
You can use prefix ftpis:// and ftpes:// instead of ftps.
Author of Total Commander
https://www.ghisler.com
krapet
Junior Member
Junior Member
Posts: 21
Joined: 2007-08-02, 06:39 UTC
Location: Czech

Re: When copying via FTP, the date is set to "today"

Post by *krapet »

More user friendly is to choose method of time synchronization witch selection of: NONE, MDTM, MFMT or SITE UTIME
instead of modifying ini file
Normally this isn't necessary because well written FTP servers report in the reply to the FEAT command when they support these commands.
Where is the trouble when FTP server identifying itself as
220 (vsFTPd 3.0.2)
and responds on FEAT command:

Code: Select all

211-Features:
 AUTH TLS
 EPRT
 EPSV
 MDTM
 PASV
 PBSZ
 PROT
 REST STREAM
 SIZE
 TVFS
 UTF8
211 End
As you can see MDTM is presented in reported features but without setting of SpecialFlag all uploaded files have time of upload not time of original file.
Related issue appears when I duplicate FTP connection. The SpecialFlag is not duplicated.


I also found that checkbox SSL/TLS may not be sufficient. Some servers distinguish between implicit and explicit methods.
You can use prefix ftpis:// and ftpes:// instead of ftps.
Thank you for hint. It helped.
Do you plan to add some kind tool for selection or at least this hint also in FTP connection menu?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: When copying via FTP, the date is set to "today"

Post by *ghisler(Author) »

MDTM is the command to retrieve the file timestamp.
Servers need to report either
MDTM YYYYMMDDHHMMSS
or the newer
MFMT
for Total Commander to set the timestamp.
Author of Total Commander
https://www.ghisler.com
krapet
Junior Member
Junior Member
Posts: 21
Joined: 2007-08-02, 06:39 UTC
Location: Czech

Re: When copying via FTP, the date is set to "today"

Post by *krapet »

Unfortunately the vsFTPd (widely used) still doesn't support MLSD.
Only LIST command is available and I'm unable to persuade my provider to change ftp server.

But why TC doesn't shift received times (got by LIST command) from UTC to local time?
For example in case when one of corresponding SpecialFlags is set.
Or better using check box in FTP: connection details -> Advanced

Could you implement time shift (of received timestamps from UTC to local time) in some next release?
Post Reply