Table of Contents

Property Preserve

Namespace
SshSharp.Sftp
Assembly
SshSharp.dll

Preserve

Copy the source's modification and access times, and its permission bits (read, write and execute for the owner, the group and others), to the destination, as sftp -p does. Permissions are copied only where the receiving side has Unix modes: a download to Windows keeps the times only, and an upload from Windows sends none. Unlike OpenSSH, setuid, setgid and the sticky bit are never copied, so a server cannot hand this machine a setuid file. An upload sets a file's attributes through its open handle before closing it, and a directory's without following a symbolic link (lsetstat@openssh.com, where the server has it), so another user who replaces either with a link meanwhile cannot have them applied to the link's target.

public bool Preserve { get; init; }

Property Value

bool