Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

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

I'll consider that.
NottaSmartMan

Would it be possible to just have WinSCP ignore/skip the attempt to preserve the timestamp rather than just error out?

With such an odd last-modified date so far in the future, I'd be okay with the script just skipping the time setting step for that single file rather than crashing.

I suppose this would be considered more of a feature request than a bug at this point. I've only run across one file like this so far, so I'd say the priority is low. I did save a copy of it for future testing if need be though.
martin

Ok, WinSCP indeed supports dates up to 9999 year only.
Making it support later dates is quite some work and I do not really think it's worth the effort. Sorry.
Even more so considering, that most SFTP servers support dates up to 2038 only anyway.
NottaSmartMan

Correct, it transfers fine if I do NOT preserve the timestamp.

It only errors if I do try to preserve the timestamp (be it via powershell script or using the standard WinSCP GUI)
martin

Re: Error: Invalid argument to date encode

So the 12832 year seems to be the actual modification date of the file. The Explorer probably just fails to be able to display it in the file list.
Does the file upload, if you do not ask for preserving the timestamp?
NottaSmartMan

In this case, the source file is located on a Network/UNC path.

However, I was able to copy the file locally and retain the "no modification date'.

Attached is a picture showing the 'no modification date' in explorer and how windows represents it when you look at the file properties.
martin

Re: Error: Invalid argument to date encode

Where does the file come from? Is it a regular local disk? Or some network path?
NottaSmartMan

Error: Invalid argument to date encode

I'm getting an error of "Invalid argument to date encode [12832-11-1]" when I try to upload a file via SFTP. It looks like the reason is because there's no "modified" date for the file.

I get this error in the WinSCP GUI (see attachment) as well as when synchronizing folders via script. Pretty cool situation, but I'm not sure what to do.

Setting the timestamp to a default time (matching the created date?) would be fine with me if possible.

Currently, this just abort. From a script, I get the following output:
< 2024-11-03 23:15:05.642 Script: Invalid argument to date encode [12832-09-17 08:18:46.136]
. 2024-11-03 23:15:05.643 Script: Failed
. 2024-11-03 23:15:05.643 Session upkeep
. 2024-11-03 23:15:05.643 Looking for network events
. 2024-11-03 23:15:05.643 Timeout waiting for network events
> 2024-11-03 23:15:05.781 Script: exit