Table of Contents

Property TimeTolerance

Namespace
SshSharp.Sftp
Assembly
SshSharp.dll

TimeTolerance

How far apart the modification times may be for SkipUnchanged to take a file as unchanged, as rsync's --modify-window (default zero: the same second). Set it when one side keeps coarser times than a second, so the times copied with Preserve come back rounded: 2 seconds for FAT and exFAT (USB drives, SD cards), and for SMB shares backed by them; a second for a server or share that rounds to the nearest second rather than dropping the fraction. Without it every file on such a file system is transferred again.

public TimeSpan TimeTolerance { get; init; }

Property Value

TimeSpan

Remarks

The times are compared in whole seconds (SFTP version 3 carries no more), so a tolerance below a second is the same as none, and a fraction above whole seconds is dropped. The sizes must still be equal. A wider tolerance hides more real changes: a file rewritten with the same size within that time of the earlier copy is taken as unchanged. It is not meant for clocks in different time zones or for a daylight-saving shift on FAT (an hour): a tolerance that wide would miss most edits.

Exceptions

ArgumentOutOfRangeException

The value is negative.