Xceed .NET Libraries Documentation
SetDefaultAutomaticWriteFileShare Method


Xceed.SSH.Client Assembly > Xceed.SSH.Client Namespace > SFtpFile Class : SetDefaultAutomaticWriteFileShare Method
A System.IO.FileShare value representing the default value to be used when opening write streams for copy/move operations. Can be a null reference (Nothing in Visual Basic) to revert to the default value.
Sets a value indicating the default FileShare value to be used when opening write streams for copy/move operations.
Syntax
'Declaration
 
Public Shared Sub SetDefaultAutomaticWriteFileShare( _
   ByVal share As Nullable(Of FileShare) _
) 
'Usage
 
Dim share As Nullable(Of FileShare)
 
SFtpFile.SetDefaultAutomaticWriteFileShare(share)
public static void SetDefaultAutomaticWriteFileShare( 
   Nullable<FileShare> share
)

Parameters

share
A System.IO.FileShare value representing the default value to be used when opening write streams for copy/move operations. Can be a null reference (Nothing in Visual Basic) to revert to the default value.
Remarks

Because the property is global, changing the value will affect every SFtpFile operation across your entire application, not just the current SFtp session.

In most cases, it is not necessary to modify the default value of this property. But if the SFtp server supports it, it is good practice to set the value to FileShare.None.

Example
Changing FileShare options
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

SFtpFile Class
SFtpFile Members
DefaultAutomaticWriteFileShare Property

Information

Handling File Sharing Issues