Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Why should thisnever happen with Session.SynchronizeDire

If I create a file at 4:00P and then use this program to ftp it, when it ends up in the destination folder, the datetime on the file is 12:00P.

Do you refer to upload or download? I assume that download, as you do not seem to upload at all.
Can you attach a log file showing two consecutive synchronizations, where at least the first synchronization actually downloads some file (with wrong timestamp) and the second synchronization either downloads the same file or determines that the file does not need synchronization? Please mention a name of the file I should look for in the log file.
codenat

Re: Why should thisnever happen with Session.SynchronizeDire

martin wrote:

Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate log file, set Session.SessionLogPath. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.


A log was already attached above along with the jpg mentioned that you were asking about.
codenat

test
martin

Re: Why should thisnever happen with Session.SynchronizeDire

Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate log file, set Session.SessionLogPath. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.
codenat

Re: Why should thisnever happen with Session.SynchronizeDire

martin wrote:

codenat wrote:

We'll just live with the weird time differences for now.

Not sure how this statement relates.


codenat wrote:

I don't know if this is related but the datetime of the file at the end of the process is 4 hours earlier than the current time at the beginning.

If I create a file at 4:00P and then use this program to ftp it, when it ends up in the destination folder, the datetime on the file is 12:00P. If I look at the properties, it says:
created: 30 minutes ago
modified: 5 hours ago
accessed: 30 minutes ago
(see attached jpg)


the attached jpg is in above post
martin

Re: Why should thisnever happen with Session.SynchronizeDire

codenat wrote:

We'll just live with the weird time differences for now.

Not sure how this statement relates.
codenat

Re: Why should thisnever happen with Session.SynchronizeDire

Many thanks!!

We'll just live with the weird time differences for now.
martin

Re: Why should thisnever happen with Session.SynchronizeDire

You are using "remote to local" synchronization (The .Touch will always be null).

While the example is for "local to remote" synchronization.

I have updated the comment to "This should never happen during "local to remote" synchronization"
codenat

Re: Why should thisnever happen with Session.SynchronizeDire

Attached is a log.

I don't know if this is related but the datetime of the file at the end of the process is 4 hours earlier than the current time at the beginning.

If I create a file at 4:00P and then use this program to ftp it, when it ends up in the destination folder, the datetime on the file is 12:00P. If I look at the properties, it says:
created: 30 minutes ago
modified: 5 hours ago
accessed: 30 minutes ago
(see attached jpg)

Thanks for your help
Nat
martin

Re: Why should thisnever happen with Session.SynchronizeDirector

Well, it can actually happen, when the server does not support changing remote file timestamp. But that makes the synchronization impossible.

Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate log file, set Session.SessionLogPath. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.
codenat

Why should thisnever happen with Session.SynchronizeDirector

Howdy,
So I am using the .net Assembly for a windows service that synchronizes a folder on the FTP server with a folder on the file share server. I found how to do this here: https://winscp.net/eng/docs/library_session_synchronizedirectories

Near the bottom of the sample code is the following:

        if (e.Touch != null)

        {
            if (e.Touch.Error == null)
            {
                Console.WriteLine("Timestamp of {0} set to {1}", e.Touch.FileName, e.Touch.LastWriteTime);
            }
            else
            {
                Console.WriteLine("Setting timestamp of {0} failed: {1}", e.Touch.FileName, e.Touch.Error);
            }
        }
        else
        {
            // This should never happen with Session.SynchronizeDirectories
            Console.WriteLine("Timestamp of {0} kept with its default (current time)", e.Destination);
        }


I don't understand the comment // This should never happen with Session.SynchronizeDirectories.
Could someone explain to me why this should never happen. It currently happens with my service and I am not sure why it shouldn't.

Thanks for your help!