PowerTCP FTP for .NET
Synchronize Enumeration
Example Example 



Enumerates synchronization options for selected high-level Get and Put methods.
Syntax
<FlagsAttribute()>
Public Enum Synchronize 
   Inherits System.Enum
Dim instance As Synchronize
[Flags()]
public enum Synchronize : System.Enum 
[Flags()]
public enum class Synchronize : public System.Enum 
Members
MemberDescription
Off No synchronization - the entire file will always be copied.
On Synchronizes the source to the destination.
SetDateTime Sets the destination file's modified DateTime to the source file's after the transfer operation is complete.
Remarks

The values of this enumeration can be used as bit flags to indicate multiple techniques.

WARNING: The synchronization algorithm used by Synchronize.On is not suitable for ALL scenarios, so you should ensure its use is compatible with technical requirements:

If the destination file DateTime (UTC, LastWrittenTo) is more recent or the same as the source file, then the files are considered synchronized. If the files are synchronized and the sizes match, then no copy is performed. If the files are synchronized and the destination file is smaller, then the missing bytes are appended. If the files are synchronized and the destination file is bigger, then corruption is assumed and a full copy is performed. If the files are not synchronized, then a full copy is performed.

Synchronize.SetDateTime - This option indicates that the destination file DateTime (UTC, LastWrittenTo) should be set to the source DateTime after the transfer operation is complete. Server support for the MFMT (Modify Fact: Modification Time) command or MDTM set is required to update the destination file's DateTime when Put is used. No Exception is thrown if the attempt fails - check CopyResult.DateTimeSet to confirm that the action was completed successfully.

Example
This example demonstrates how to use the synchronize enumeration to synchronize files, and automatically set the modified date.
private void putFile()
{
    ftp1.Get("testfile.txt", myLocalDirectory + "\\testfile.txt", Synchronize.On | Synchronize.SetDateTime);
}
Private Sub putFile()
    ftp1.Get("testfile.txt", myLocalDirectory & "\testfile.txt", Synchronize.Off Or Synchronize.SetDateTime)
End Sub
Inheritance Hierarchy

System.Object
   System.ValueType
      System.Enum
         Dart.Ftp.Synchronize

See Also

Reference

Dart.Ftp Namespace


PowerTCP FTP for .NET Documentation Version 6.1
© 2023 Dart Communications. All Rights Reserved.
Send comments on this topic