Session.MoveFile to Preserve Directory Time Stamps

Advertisement

johnhamborg
Joined:
Posts:
5
Location:
Earth

Session.MoveFile to Preserve Directory Time Stamps

I am using Session.MoveFile archive all files that older than a certain date as an archival process. The issue I have is that while it does preserve the file time stamp, it does not preserve the directory timestamp.

Can you advise? The Session.MoveFile method only has 2 arguments From and To with no way to specify a transfer options variable.

I'd like to use $transferOptions.AddRawSettings("PreserveTimeDirs", "1") but that does not appear to be an available option for Session.MoveFile.

Thanks so much!

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,984
Location:
Prague, Czechia

Re: Session.MoveFile to Preserve Directory Time Stamps

The timestamp of the moved directory should not change (if you move it within the same file system). But WinSCP does not control that anyhow. The server does. What server is that? What file system? What protocol? Post some logs (including directory listings before and after the move). Do you see the same behaviour in WinSCP GUI?

Reply with quote

Advertisement

You can post new topics in this forum