NFSClient Component

Properties   Methods   Events   Config Settings   Errors  

This component is used to create a Network File System (NFS) client based on NFS version 4.0.

Syntax

callback.NFSSDK.NFSClient

Remarks

This component provides a simple way to create a Network File System (NFS) client, enabling seamless connection and access to files hosted on an NFS server.

Getting Started

To begin, the RemoteHost and RemotePort properties should first be set to the host and port of the NFS server. By default, the RemotePort property is set to 2049. The LocalHost and LocalPort properties may also be set to specify the name of the local host or user-assigned IP interface through which connections are initiated. Note that NFS exports may require that requests originate from a port less than 1024 (IPPORT_RESERVED). In this case, LocalPort should be manually specified.

The SecurityMechanism (and other related properties) may also be set beforehand. Please refer to the security section below for additional details.

Once set, the Connect method should be called to initiate a connection to the server. For example:

component.RemoteHost = "10.0.1.123"; component.RemotePort = 2049; component.Connect();

Once the connection is successful (or fails), the Connected event will fire accordingly, with details regarding the connection status. Assuming the connection was successful, the Connected property will be set to True.

After successfully connecting to the NFS server, the RemotePath will always be set to the root from the components perspective, /.

If the server exports a specific directory (e.g., /mnt/mynfs), the component may need to navigate to this export manually by calling ChangeRemotePath with the relevant export path.

In some server-side configurations, the client may already start in the exported directory upon a connection, allowing immediate access without additional navigation.

Security

Before connecting to the server, the SecurityMechanism should be set accordingly. This property may be set to one of the following mechanisms:

MechanismDescription
noneNo authentication is required to establish a connection to the server (AUTH_NONE or AUTH_NULL).
sysSystem authentication is required to establish a connection to the server (AUTH_SYS or AUTH_UNIX).
krb5Kerberos v5 with client authentication only.
krb5iKerberos v5 with client authentication and integrity protection.
krb5pKerberos v5 with client authentication, integrity protection, and encryption.

System Authentication

By default, SecurityMechanism is set to sys, enabling RPC system authentication (AUTH_SYS). In this case, the RPCUid and RPCGid properties are used to specify the UID and GID the component should perform the request as. These properties are set to 0 by default, indicating root access.

Note: This mechanism is not secure. Network packets are still transferred in plaintext. This mechanism is only recommended for systems operating over a local network.

Kerberos Authentication

For additional security, the SecurityMechanism may be set to krb5, krb5i, or krb5p to enable RPC Kerberos authentication (RPCSEC_GSS).

It is important to note the differences between the listed Kerberos security mechanisms. If krb5 is utilized, Kerberos will only be used to perform client authentication.

If krb5i is utilized, Kerberos will be used to perform client authentication and integrity protection, ensuring that incoming and outgoing packets are untampered. However, packets remain unencrypted, making sensitive data potentially visible to anyone monitoring the network.

If krb5p is utilized, Kerberos will be used to perform client authentication, integrity protection, and packet encryption, making this the most secure option.

If the security mechanism is set to any of the Kerberos security mechanisms, the following properties must also be set accordingly:

For example, connecting with a Kerberos security mechanism may look like:

// Configure general settings nfsclient.RemoteHost = "10.0.1.223"; nfsclient.RemotePort = 2049; nfsclient.SecurityMechanism = "krb5p"; // Configure kerberos settings nfsclient.KDCHost = "10.0.1.226"; nfsclient.User = "nfsclient@EXAMPLE.COM"; nfsclient.SPN = "nfs/nfs-server.example.com"; nfsclient.KeytabFile = "C:\\nfsclient.keytab"; // alternative to 'Password' nfsclient.Connect();

Navigating the Server

As mentioned previously, upon successfully connecting to the NFS server, the RemotePath will always be set to the root from the components perspective, /. ChangeRemotePath may or may not need to be called to navigate to the relevant server-side export.

Regardless, many methods operate based on the current working directory of the component as identified by RemotePath. For example, when calling ListDirectory, the directory contents of the current RemotePath will be listed.

As such, the ChangeRemotePath method can be used to change the current working directory of the component to some specified path. Both relative and absolute paths are supported with this method.

Absolute Paths

If the path begins with a /, it is considered an absolute path and must specify the entire path from the root of the server. For example:

component.ChangeRemotePath("/home/testuser/myfolder");

Relative Paths

If the path does not begin with a /, it is considered a relative path and is resolved in relation to the current directory. For instance, a value of myfolder will indicate a subfolder of the current directory. The special value .. refers to the parent directory of the current path. For example:

//Change to the 'myfolder' sub-directory component.ChangeRemotePath("myfolder"); //Navigate up two levels and then into the 'another/folder' path. component.ChangeRemotePath("../../another/folder");

Note that absolute and relative paths are supported for almost every component method that takes a file name and path as a parameter. Additionally, absolute and relative paths are supported by the RemoteFile property, which many methods make use of. For more information, please refer to the below section and individual method descriptions.

Managing Files and Directories

This section describes many different operations that can be performed on the NFS server. Before going into additional details, it is important to note that the behavior of many methods here operate depending on whether the specified RemoteFile or method parameter is an absolute or relative path.

If the specified RemoteFile or method parameter is an absolute path, the current RemotePath will be ignored in favor of the absolute path. However, if the specified RemoteFile or method parameter is a relative path, the operation will be performed relative to the current RemotePath.

File Lookup

To check whether a file or directory exists in the NFS server, the CheckFileExists method may be used. This method will search for the object specified by RemoteFile. For example:

// Relative Path component.ChangeRemotePath("/home/testuser/myfolder"); component.RemoteFile = "test.txt"; // Checks for test.txt in /home/testuser/myfolder if(component.CheckFileExists()) { component.Download(); } // Absolute Path component.RemoteFile = "/home/test/test.txt"; // Checks for test.txt in /home/test if(component.CheckFileExists()) { component.Download(); }

Listing Directories

To list the contents of a directory, the ListDirectory method should be called to retrieve the entries of the current working directory (as indicated by the current RemotePath).

The DirList event will fire for each entry in the current directory. The RemoteFile property may be used to specify a file mask for filtering the entries returned via DirList.

For example:

// List all text files in /home/test component.OnDirList += (o, e) => { Console.WriteLine("Dir Entry: " + e.FileName); }; component.ChangeRemotePath("/home/test"); component.RemoteFile = "*.txt"; component.ListDirectory();

Note: Because RemoteFile acts as a file mask, to retrieve a complete directory listing RemoteFile should be set to an empty string (or a mask like "*").

For more information about using RemoteFile as a filemask, please refer to the RemoteFile or ListDirectory documentation.

Create and Delete Objects

Files and directories may be created using CreateFile and MakeDirectory, respectively. Note that CreateFile is used to create a new file containing no data. To create a new file with content, please refer to the Upload method. For example:

// Create directory component.MakeDirectory("testdir"); // Create empty file in new directory component.ChangeRemotePath("testdir"); component.CreateFile("test.txt");

Files and directories may be deleted using DeleteFile and RemoveDirectory, respectively. For example (based on the previous directory structure in the last example):

// Remove file created previously component.ChangeRemotePath("testdir"); component.DeleteFile("test.txt"); // Navigate out of directory component.ChangeRemotePath("../"); component.RemoveDirectory("testdir");

Uploading Files

As mentioned, CreateFile may be used to create a new, empty file. To upload a file with content, the Upload method should be used. The RemoteFile property will specify the remote location to upload the local data to. If the RemoteFile exists and Overwrite is set to false, an error will occur while uploading.

The component can either upload the specified LocalFile, or upload the contents of a stream, which can be set via SetUploadStream. When uploading via a stream, the CloseStreamAfterTransfer config may be set to determine whether or not to close the stream after the transfer (enabled by default).

As an alternative to Upload, the UploadRange method may be used to upload a specified number of bytes to a given position in the RemoteFile. This method can also be used to append data to the end of a file, however, the Append method may be also be used for this purpose. For specific examples, please refer to the documentation for each method.

Downloading Files

To download the content of a file hosted on the server, the Download method should be used. The RemoteFile property should be set to the remote file to download. The LocalFile property can be used to specify a local file to download the specified remote file to. If the LocalFile already exists and Overwrite is false, an error will occur.

The component can either download the remote file contents to the specified LocalFile, or download the contents to a stream, which can be set via SetDownloadStream. When downloading via a stream, the CloseStreamAfterTransfer config may be set to determine whether or not to close the stream after the transfer (enabled by default).

As an alternative to Download, the DownloadRange method may be used to download a specified number of bytes to some local buffer.

Lastly, as an alternative to LocalFile or SetDownloadStream, the downloaded file contents are also available in the Transfer event. Note the Transfer event will always fire containing the transferred data, so data may be retrieved here even if LocalFile is set or SetDownloadStream is called. For specific examples, please refer to the documentation for each method.

Creating and Reading Links

The component supports creating hard links and symbolic links using the CreateLink method.

CreateLink takes three parameters, the name of the link to be created, the target of the link, and the type of link (hard link or symbolic link). Please see below for a simple example:

nfs.ChangeRemotePath("/nfs"); // Create symlink.txt in /nfs pointing to existing_file.txt in the same directory nfs.CreateLink("symlink.txt", "existing_file.txt", 0); // Create hardlink.txt in /nfs pointing to existing_file.txt in the same directory nfs.CreateLink("hardlink.txt", "existing_file.txt", 1);

To read a hard link, you can set the RemoteFile property to the name of the hard link, and call Download (with the relevant local file or stream set).

However, reading a symbolic link requires some additional steps. First, the ReadLink method should be called, which will return a byte array containing the contents of the symbolic link as stored on the server. Typically, the contents are a file name that the link points to. Before going into detail, please see below for a simple example:

nfs.ChangeRemotePath("/nfs"); // Create symlink.txt in /nfs pointing to existing_file.txt in the same directory nfs.CreateLink("symlink.txt", "existing_file.txt", 0); // Read link byte[] linkData = nfs.ReadLink("symlink.txt"); string file = Encoding.UTF8.GetString(linkData); nfs.RemoteFile = file; nfs.LocalFile = "temp.txt"; nfs.Download();

In NFS v4.0, the contents of a symbolic link are treated as opaque (binary data) at the protocol level. The server stores this opaque data and returns this to the client when requested, meaning it is up to the client to interpret the link data.

Most of the time, the opaque data will represent the file the symbolic link is pointing to relative to the position of the symbolic link, meaning it can be converted to a UTF8 string representing this file. The contents of the file should then be downloaded by setting RemoteFile (and possibly RemotePath) accordingly and calling Download.

Handling File Attributes

The component provides a couple of ways to handle file attributes. As mentioned previously, when calling ListDirectory, the DirList event will fire for each directory entry. During this event, the FileAttributes collection will be populated with the attributes of the associated directory entry. Note that the attributes are only meant to be retrieved during this event, rather than set.

Outside of DirList, the QueryFileAttributes method must be called to retrieve a file's attributes. After doing so, the FileAttributes property will be populated accordingly.

To update relevant file attributes, the FileAttributes property can be modified, and UpdateFileAttributes can be called to make those changes remotely. Note that not all attributes are able to be modified. Please see below for a simple example:

// First, query attributes component.RemoteFile = "/home/test/test.txt"; component.QueryFileAttributes(); // Update OwnerId and OwnerGroupId of file component.FileAttributes.OwnerId = "1000"; component.FileAttributes.OwnerGroupId = "1000"; component.UpdateFileAttributes();

Property List


The following is the full list of the properties of the component with short descriptions. Click on the links for further details.

ConnectedWhether the component is connected.
FileAttributesThe attributes of the RemoteFile .
FirewallA set of properties related to firewall access.
KDCHostSpecifies domain name or IP address of the Key Distribution Center (KDC).
KDCPortSpecifies the port for the Key Distribution Center (KDC)
KeytabFileSpecifies the path to the Kerberos Keytab file.
LocalFileThis is the path to a local file for download or upload. If the file exists, it is overwritten.
LocalHostThe name of the local host or user-assigned IP interface through which connections are initiated or accepted.
LocalPortThe TCP port in the local host where the component binds.
OverwriteThis indicates whether the component should overwrite the local or remote file during a download or upload.
PasswordSpecifies the password of the User to authenticate.
RemoteFileThis is the name of the remote file for uploading, downloading, and performing other operations.
RemoteHostSpecifies the address of the NFS server.
RemotePathSpecifies the current path in the NFS server.
RemotePortSpecifies the port the NFS server is listening on.
RPCGidSpecifies the group identifier (GID) associated with requests during RPC system authentication.
RPCUidSpecifies the user identifier (UID) associated with requests during RPC system authentication.
SecurityMechanismSpecifies the RPC security mechanism the client should use when connecting to the NFS Server.
SPNSpecifies the Service Principal Name (SPN).
StartByteThe offset in bytes at which to begin the Upload or Download.
TimeoutThis property includes the timeout for the component.
UserSpecifies the name and domain of the user to authenticate.

Method List


The following is the full list of the methods of the component with short descriptions. Click on the links for further details.

AbortAborts the current upload or download.
AppendAppends data from LocalFile to a remote file RemoteFile on a NFS server.
ChangeRemotePathChanges the current path on the server.
CheckFileExistsChecks whether the file specified by RemoteFile exists on the server.
ConfigSets or retrieves a configuration setting.
ConnectThis method connects to the NFS server.
CreateFileCreates a file on the NFS server.
CreateLinkCreates a hard link or symbolic link on the server.
DeleteFileThis method removes a file specified by FileName from the server.
DisconnectThis method disconnects from the NFS server.
DoEventsThis method processes events from the internal message queue.
DownloadThis method downloads a remote file from the NFS server.
DownloadRangeThis method downloads a specific segment of a remote file from a NFS server.
ListDirectoryThis method lists the current working directory on the NFS server.
MakeDirectoryThis method is used to create a directory on the NFS server.
QueryFileAttributesThis method queries the server for the file attributes of the specified RemoteFile
ReadLinkReads a symbolic link on the server.
RemoveDirectoryThis removes a directory specified by DirName from the NFS server.
RenameFileThis changes the name of RemoteFile to NewName .
ResetThis method will reset the component.
SetDownloadStreamThis method sets the stream to which the downloaded data from the server will be written.
SetUploadStreamThis method sets the stream from which the component will read data to upload to the server.
UpdateFileAttributesThis method updates the FileAttributes for the current RemoteFile .
UploadThis method uploads a file to the NFS server.
UploadRangeThis method uploads a specific segment of data into a remote file on the NFS server.

Event List


The following is the full list of the events fired by the component with short descriptions. Click on the links for further details.

ConnectedFired immediately after a connection completes (or fails).
DirListThis event fires when a directory entry is received.
DisconnectedThis event is fired when a connection is closed.
EndTransferThis event is fired when a file finishes uploading or downloading.
ErrorFired when information is available about errors during data delivery.
LogThis event is fired once for each log message.
StartTransferThis event is fired when a file starts uploading or downloading.
TransferThis event is fired during the file download or upload.

Config Settings


The following is a list of config settings for the component with short descriptions. Click on the links for further details.

AppendToLocalFileWhether to append downloaded files to a local file.
ClientIDSeekSpecifies some identifier used when creating the client ID associated with the current connection.
DirCountSizeSpecifies the maximum number of bytes that may be returned in a single READDIR request.
FileTimeFormatSpecifies the format to use when returning filetime strings.
MaxReadBytesIndicates the maximum number of bytes that will be returned in one READ operation.
MaxWriteBytesIndicates the maximum number of bytes that will be written in one WRITE operation.
OpenOwnerSpecifies an opaque string representing the client when opening a file.
RPCAuxiliaryGidsSpecifies the Auxiliary GIDs (or groups) the client is a part of.
RPCHostnameSpecifies the host (or machine) name of the client.
STMaskSpecifies the default file mode (or permission) bits to exclude when creating a file.
UsePlatformKerberosAPIWhether to use the platform Kerberos API.
XAttrCountSizeSpecifies the maximum number of bytes that may be returned in a single LISTXATTRS request.
BuildInfoInformation about the product's build.
GUIAvailableWhether or not a message loop is available for processing events.
LicenseInfoInformation about the current license.
MaskSensitiveDataWhether sensitive data is masked in log messages.
UseInternalSecurityAPIWhether or not to use the system security libraries or an internal implementation.

Connected Property (NFSClient Component)

Whether the component is connected.

Syntax

public bool Connected { get; }
Public ReadOnly Property Connected As Boolean

Default Value

False

Remarks

This property is used to determine whether or not the component is connected to the remote host. Use the Connect and Disconnect methods to manage the connection.

This property is read-only and not available at design time.

FileAttributes Property (NFSClient Component)

The attributes of the RemoteFile .

Syntax

public NFSFileAttributes FileAttributes { get; set; }
Public Property FileAttributes As NFSFileAttributes

Remarks

This property holds the attributes for the file specified by RemoteFile. Before querying this property, first call QueryFileAttributes to retrieve the attributes from the server.

To modify the attributes of the file, you may set FileAttributes and then call UpdateFileAttributes.

Note that this property will also be populated during the ListDirectory operation, and are made temporarily available within the DirList event.

This property is not available at design time.

Please refer to the NFSFileAttributes type for a complete list of fields.

Firewall Property (NFSClient Component)

A set of properties related to firewall access.

Syntax

public Firewall Firewall { get; set; }
Public Property Firewall As Firewall

Remarks

This is a Firewall-type property, which contains fields describing the firewall through which the component will attempt to connect.

Please refer to the Firewall type for a complete list of fields.

KDCHost Property (NFSClient Component)

Specifies domain name or IP address of the Key Distribution Center (KDC).

Syntax

public string KDCHost { get; set; }
Public Property KDCHost As String

Default Value

""

Remarks

This property specifies the domain name or IP address of the Key Distribution Center (KDC).

If this property is set to a Domain Name, a DNS request is initiated and upon successful termination of the request, this property is set to the corresponding address. If the search is not successful, an error is returned.

Note that this property is only applicable when SecurityMechanism is set to krb5, krb5i, or krb5p.

KDCPort Property (NFSClient Component)

Specifies the port for the Key Distribution Center (KDC)

Syntax

public int KDCPort { get; set; }
Public Property KDCPort As Integer

Default Value

88

Remarks

This property specifies the port for the Key Distribution Center (KDC). The default value is 88.

Note that this property is only applicable when SecurityMechanism is set to krb5, krb5i, or krb5p.

KeytabFile Property (NFSClient Component)

Specifies the path to the Kerberos Keytab file.

Syntax

public string KeytabFile { get; set; }
Public Property KeytabFile As String

Default Value

""

Remarks

This property specifies the path to a Kerberos Keytab file.

If specified, the credentials for a specific User are read from this file, assuming an entry for the user exists in the file. The Password should not be specified if using a Keytab file.

Note that this property is only applicable when SecurityMechanism is set to krb5, krb5i, or krb5p.

LocalFile Property (NFSClient Component)

This is the path to a local file for download or upload. If the file exists, it is overwritten.

Syntax

public string LocalFile { get; set; }
Public Property LocalFile As String

Default Value

""

Remarks

This property is used by the Upload and Download methods to specify the path to a local file to be downloaded or uploaded. See the method descriptions for more information.

Example (Setting LocalFile)

// Download remotefile.txt to C:\\localfile.txt component.LocalFile = "C:\\localfile.txt"; component.RemoteFile = "remotefile.txt"; component.Download(); // Upload C:\\localfile2.txt to folder/remotefile2.txt component.LocalFile = "C:\\localfile2.txt"; component.RemoteFile = "folder/remotefile2.txt"; component.Upload();

LocalHost Property (NFSClient Component)

The name of the local host or user-assigned IP interface through which connections are initiated or accepted.

Syntax

public string LocalHost { get; set; }
Public Property LocalHost As String

Default Value

""

Remarks

This property contains the name of the local host as obtained by the gethostname() system call, or if the user has assigned an IP address, the value of that address.

In multihomed hosts (machines with more than one IP interface) setting LocalHost to the IP address of an interface will make the component initiate connections (or accept in the case of server components) only through that interface. It is recommended to provide an IP address rather than a hostname when setting this property to ensure the desired interface is used.

If the component is connected, the LocalHost property shows the IP address of the interface through which the connection is made in internet dotted format (aaa.bbb.ccc.ddd). In most cases, this is the address of the local host, except for multihomed hosts (machines with more than one IP interface).

Note: LocalHost is not persistent. You must always set it in code, and never in the property window.

LocalPort Property (NFSClient Component)

The TCP port in the local host where the component binds.

Syntax

public int LocalPort { get; set; }
Public Property LocalPort As Integer

Default Value

0

Remarks

This property must be set before a connection is attempted. It instructs the component to bind to a specific port (or communication endpoint) in the local machine.

Setting this property to 0 (default) enables the system to choose an open port at random. The chosen port will be returned by the LocalPort property after the connection is established.

LocalPort cannot be changed once a connection is made. Any attempt to set this property when a connection is active will generate an error.

This property is useful when trying to connect to services that require a trusted port on the client side.

Note: NFS exports may require that requests originate from a port less than 1024 (IPPORT_RESERVED). In this case, this property should be manually specified.

Overwrite Property (NFSClient Component)

This indicates whether the component should overwrite the local or remote file during a download or upload.

Syntax

public bool Overwrite { get; set; }
Public Property Overwrite As Boolean

Default Value

False

Remarks

This property indicates whether the component should overwrite any local or remote files when calling Download, Upload, or CreateFile.

When uploading and Overwrite is false, an error will be thrown if the specified RemoteFile exists. When true, the RemoteFile will be overwritten.

When downloading and Overwrite is false, an error will be thrown if the specified LocalFile exists. When true, the LocalFile will be overwritten.

Password Property (NFSClient Component)

Specifies the password of the User to authenticate.

Syntax

public string Password { get; set; }
Public Property Password As String

Default Value

""

Remarks

This property specifies the password of the User to authenticate.

Note that this property is only applicable when SecurityMechanism is set to krb5, krb5i, or krb5p.

RemoteFile Property (NFSClient Component)

This is the name of the remote file for uploading, downloading, and performing other operations.

Syntax

public string RemoteFile { get; set; }
Public Property RemoteFile As String

Default Value

""

Remarks

This property contains the name of the remote file to be uploaded or downloaded and is either an absolute file path or a relative path based on the remote path set by calling ChangeRemotePath.

A number of methods use RemoteFile as an argument.

Example 1. Setting RemoteFile:

component.LocalFile = "C:\\localfile.txt"; component.RemoteFile = "remotefile.txt"; component.Download(); component.LocalFile = "C:\\localfile2.txt"; component.RemoteFile = "folder/remotefile2.txt"; component.Download();

Note: This property will also act as a file mask when calling ListDirectory.

Example 2. Using RemoteFile as a file mask: component.RemoteFile = "*.txt" component.ListDirectory()

The following special characters are supported for pattern matching:

? Any single character.
* Any characters or no characters (e.g., C*t matches Cat, Cot, Coast, Ct).
[,-] A range of characters (e.g., [a-z], [a], [0-9], [0-9,a-d,f,r-z]).
\ The slash is ignored and exact matching is performed on the next character.

If these characters need to be used as a literal in a pattern, then they must be escaped by surrounding them with brackets []. Note: "]" and "-" do not need to be escaped. See below for the escape sequences:

CharacterEscape Sequence
? [?]
* [*]
[ [[]
\ [\]

For example, to match the value [Something].txt, specify the pattern [[]Something].txt.

RemoteHost Property (NFSClient Component)

Specifies the address of the NFS server.

Syntax

public string RemoteHost { get; set; }
Public Property RemoteHost As String

Default Value

""

Remarks

This property specifies the IP address (IP number in dotted internet format) or the domain name of the NFS server. It is set before a connection is attempted and should not be changed once a connection is established.

RemotePath Property (NFSClient Component)

Specifies the current path in the NFS server.

Syntax

public string RemotePath { get; }
Public ReadOnly Property RemotePath As String

Default Value

""

Remarks

This property specifies the current working directory on the NFS server. The ChangeRemotePath method can be used to change the working directory to an absolute path or to a relative path with respect to the current value of RemotePath.

Example. Changing Directory:

component.RemoteHost = "nfs.server.net"; component.RemotePort = 2049; component.Connect(); component.ChangeRemotePath("/home/user"); Console.WriteLine(component.RemotePath); // Outputs "/home/user"

This property is read-only.

RemotePort Property (NFSClient Component)

Specifies the port the NFS server is listening on.

Syntax

public int RemotePort { get; set; }
Public Property RemotePort As Integer

Default Value

2049

Remarks

This property specifies the port the NFS server is listening on (i.e., the port the component will connect to).By default, this value is 2049.

A valid port number (a value between 1 and 65535) is required for the connection to take place. The property must be set before a connection is attempted and cannot be changed once a connection is established. Any attempt to change this property while connected will fail with an error.

This property is not available at design time.

RPCGid Property (NFSClient Component)

Specifies the group identifier (GID) associated with requests during RPC system authentication.

Syntax

public int RPCGid { get; set; }
Public Property RPCGid As Integer

Default Value

0

Remarks

This property specifies the group identifier (GID) associated with requests during RPC system authentication (AUTH_SYS).

The specified GID will be sent in all outgoing requests in order to identify the relevant primary group of the user making the request. The user can be identified by the RPCUid property.

Note this property is only applicable when SecurityMechanism is set to sys.

RPCUid Property (NFSClient Component)

Specifies the user identifier (UID) associated with requests during RPC system authentication.

Syntax

public int RPCUid { get; set; }
Public Property RPCUid As Integer

Default Value

0

Remarks

This property specifies the user identifier (UID) associated with requests during RPC system authentication (AUTH_SYS).

The specified UID will be sent in all outgoing requests in order to identify the user making the request.

Note this property is only applicable when SecurityMechanism is set to sys.

SecurityMechanism Property (NFSClient Component)

Specifies the RPC security mechanism the client should use when connecting to the NFS Server.

Syntax

public string SecurityMechanism { get; set; }
Public Property SecurityMechanism As String

Default Value

"sys"

Remarks

This property specifies the RPC security mechanism the client should use when connecting to the NFS server.

This property may be set to one of the following mechanisms:

MechanismDescription
noneNo authentication is required to establish a connection to the server (AUTH_NONE or AUTH_NULL).
sysSystem authentication is required to establish a connection to the server (AUTH_SYS or AUTH_UNIX).
krb5Kerberos v5 with client authentication only.
krb5iKerberos v5 with client authentication and integrity protection.
krb5pKerberos v5 with client authentication, integrity protection, and encryption.

By default, this property is set to sys, and only system authentication is supported. When set to sys, the following properties may be set to specify the UID and GID the component should perform the request as:

Kerberos Security Mechanisms

It is important to note the differences between the listed Kerberos security mechanisms. If krb5 is utilized, Kerberos will only be used to perform client authentication.

If krb5i is utilized, Kerberos will be used to perform client authentication and integrity protection, ensuring that incoming and outgoing packets are untampered. However, packets remain unencrypted, making sensitive data potentially visible to anyone monitoring the network.

If krb5p is utilized, Kerberos will be used to perform client authentication, integrity protection, and packet encryption, making this the most secure option.

If the security mechanism is set to any of the Kerberos security mechanisms, the following properties must also be set accordingly:

For example, connecting with a Kerberos security mechanism may look like:

// Configure general settings nfsclient.RemoteHost = "10.0.1.223"; nfsclient.RemotePort = 2049; nfsclient.SecurityMechanism = "krb5p"; // Configure kerberos settings nfsclient.KDCHost = "10.0.1.226"; nfsclient.User = "nfsclient@EXAMPLE.COM"; nfsclient.SPN = "nfs/nfs-server.example.com"; nfsclient.KeytabFile = "C:\\nfsclient.keytab"; // alternative to 'Password' nfsclient.Connect();

SPN Property (NFSClient Component)

Specifies the Service Principal Name (SPN).

Syntax

public string SPN { get; set; }
Public Property SPN As String

Default Value

""

Remarks

This property specifies the Service Principal Name (SPN) that the User is attempting to access. This should be set to the SPN of the remote NFS Server, if applicable.

Note that this property is only applicable when SecurityMechanism is set to krb5, krb5i, or krb5p.

StartByte Property (NFSClient Component)

The offset in bytes at which to begin the Upload or Download.

Syntax

public long StartByte { get; set; }
Public Property StartByte As Long

Default Value

0

Remarks

The StartByte property is used by the Upload and Download methods to determine at what offset to begin the transfer. This allows for resuming both uploads and downloads. The value of this property is reset to 0 after a successful transfer.

When downloading a file, this property specifies both the starting position in the RemoteFile to read from, as well as the starting position in the LocalFile (or stream, if using SetDownloadStream) to write to.

When uploading a file, this property specifies both the starting position in the LocalFile (or stream, if using SetUploadStream) to read from, as well as the starting position in the RemoteFile to write to.

Please see below for a simple example of resuming an upload:

long bytesTransferred = 0; component.OnTransfer += (o, e) => { bytesTransferred = e.BytesTransferred; }; component.LocalFile = "C:\nfs\test.txt"; component.RemoteFile = "test.txt"; bool uploadSuccessful = false; int maxRetries = 5; int retryCount = 0; while (!uploadSuccessful) { try { component.StartByte = bytesTransferred; // 0 initially, updated by Transfer event as necessary component.Upload(); uploadSuccessful = true; } catch (NFSSDKException ex) { retryCount++; if (retryCount >= maxRetries) { Console.WriteLine("Max retry attempts reached. Upload failed."); throw ex; } } }

Timeout Property (NFSClient Component)

This property includes the timeout for the component.

Syntax

public int Timeout { get; set; }
Public Property Timeout As Integer

Default Value

60

Remarks

If the Timeout property is set to 0, all operations will run uninterrupted until successful completion or an error condition is encountered.

If Timeout is set to a positive value, the component will wait for the operation to complete before returning control.

The component will use DoEvents to enter an efficient wait loop during any potential waiting period, making sure that all system events are processed immediately as they arrive. This ensures that the host application does not freeze and remains responsive.

If Timeout expires, and the operation is not yet complete, the component throws an exception.

Note: By default, all timeouts are inactivity timeouts, that is, the timeout period is extended by Timeout seconds when any amount of data is successfully sent or received.

The default value for the Timeout property is 60 seconds.

User Property (NFSClient Component)

Specifies the name and domain of the user to authenticate.

Syntax

public string User { get; set; }
Public Property User As String

Default Value

""

Remarks

This property specifies the name and realm/domain of the user to authenticate.

The value specified must be in one of the following formats:

  • user@domain
  • domain/user

Note that this property is only applicable when SecurityMechanism is set to krb5, krb5i, or krb5p.

Abort Method (NFSClient Component)

Aborts the current upload or download.

Syntax

public void Abort();

Async Version
public async Task Abort();
public async Task Abort(CancellationToken cancellationToken);
Public Sub Abort()

Async Version
Public Sub Abort() As Task
Public Sub Abort(cancellationToken As CancellationToken) As Task

Remarks

This method is used to abort the current upload or download.

Append Method (NFSClient Component)

Appends data from LocalFile to a remote file RemoteFile on a NFS server.

Syntax

public void Append();

Async Version
public async Task Append();
public async Task Append(CancellationToken cancellationToken);
Public Sub Append()

Async Version
Public Sub Append() As Task
Public Sub Append(cancellationToken As CancellationToken) As Task

Remarks

This method is similar to the Upload method, but the local file specified by LocalFile is appended to RemoteFile on the server as opposed to replacing it as with the Upload method. RemoteFile is either an absolute path on the server or a path relative to RemotePath. The server will create a file with that name if it does not already exist (similar to upload).

ChangeRemotePath Method (NFSClient Component)

Changes the current path on the server.

Syntax

public void ChangeRemotePath(string remotePath);

Async Version
public async Task ChangeRemotePath(string remotePath);
public async Task ChangeRemotePath(string remotePath, CancellationToken cancellationToken);
Public Sub ChangeRemotePath(ByVal RemotePath As String)

Async Version
Public Sub ChangeRemotePath(ByVal RemotePath As String) As Task
Public Sub ChangeRemotePath(ByVal RemotePath As String, cancellationToken As CancellationToken) As Task

Remarks

This method changes the current path on the server to the specified RemotePath parameter. When called, the component will issue a command to the server to change the directory. The RemotePath parameter may hold an absolute or relative path.

The current path on the server can be found by querying the RemotePath property.

Absolute Paths

If the path begins with a /, it is considered an absolute path and must specify the entire path from the root of the server. For example:

component.ChangeRemotePath("/home/testuser/myfolder");

Relative Paths

If the path does not begin with a /, it is considered a relative path and is resolved in relation to the current directory. For instance, a value of myfolder will indicate a subfolder of the current directory. The special value .. refers to the parent directory of the current path. For example:

//Change to the 'myfolder' sub-directory component.ChangeRemotePath("myfolder"); //Navigate up two levels and then into the 'another/folder' path. component.ChangeRemotePath("../../another/folder");

CheckFileExists Method (NFSClient Component)

Checks whether the file specified by RemoteFile exists on the server.

Syntax

public bool CheckFileExists();

Async Version
public async Task<bool> CheckFileExists();
public async Task<bool> CheckFileExists(CancellationToken cancellationToken);
Public Function CheckFileExists() As Boolean

Async Version
Public Function CheckFileExists() As Task(Of Boolean)
Public Function CheckFileExists(cancellationToken As CancellationToken) As Task(Of Boolean)

Remarks

This method checks whether the file specified by RemoteFile exists on the server. If the file exists, this method returns true, otherwise it returns false. RemoteFile must be specified before calling this method.

The RemoteFile can either specify the absolute path to the file, or a relative path based on the current working directory (indicated by the RemotePath property). For instance:

// Relative Path component.ChangeRemotePath("/home/testuser/myfolder"); component.RemoteFile = "test.txt"; // Checks for test.txt in /home/testuser/myfolder if(component.CheckFileExists()) { component.Download(); } // Absolute Path component.RemoteFile = "/home/test/test.txt"; // Checks for test.txt in /home/test if(component.CheckFileExists()) { component.Download(); }

Config Method (NFSClient Component)

Sets or retrieves a configuration setting.

Syntax

public string Config(string configurationString);

Async Version
public async Task<string> Config(string configurationString);
public async Task<string> Config(string configurationString, CancellationToken cancellationToken);
Public Function Config(ByVal ConfigurationString As String) As String

Async Version
Public Function Config(ByVal ConfigurationString As String) As Task(Of String)
Public Function Config(ByVal ConfigurationString As String, cancellationToken As CancellationToken) As Task(Of String)

Remarks

Config is a generic method available in every component. It is used to set and retrieve configuration settings for the component.

These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the component, access to these internal properties is provided through the Config method.

To set a configuration setting named PROPERTY, you must call Config("PROPERTY=VALUE"), where VALUE is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).

To read (query) the value of a configuration setting, you must call Config("PROPERTY"). The value will be returned as a string.

Connect Method (NFSClient Component)

This method connects to the NFS server.

Syntax

public void Connect();

Async Version
public async Task Connect();
public async Task Connect(CancellationToken cancellationToken);
Public Sub Connect()

Async Version
Public Sub Connect() As Task
Public Sub Connect(cancellationToken As CancellationToken) As Task

Remarks

This method establishes a connection with the NFS server specified by RemoteHost and RemotePort.

Prior to calling this method, the SecurityMechanism should be set appropriately, along with properties relevant to the specified mechanism. For example:

component.RemoteHost = "10.0.1.67"; component.RemotePort = 2049; component.Connect();

CreateFile Method (NFSClient Component)

Creates a file on the NFS server.

Syntax

public void CreateFile(string fileName);

Async Version
public async Task CreateFile(string fileName);
public async Task CreateFile(string fileName, CancellationToken cancellationToken);
Public Sub CreateFile(ByVal FileName As String)

Async Version
Public Sub CreateFile(ByVal FileName As String) As Task
Public Sub CreateFile(ByVal FileName As String, cancellationToken As CancellationToken) As Task

Remarks

This method creates an empty file on the server with the name specified by the FileName parameter.

If the specified FileName already exists, and Overwrite is false, an error will be thrown.

To upload a file with content, use Upload instead.

CreateLink Method (NFSClient Component)

Creates a hard link or symbolic link on the server.

This method is used to create a hard link or symbolic link on the server.

The LinkName parameter is the name of the link to create, and is either an absolute path on the server or a path relative to RemotePath.

The LinkTarget parameter specifies the target of the link.

The LinkType parameter indicates what type of link the component should attempt to create. Possible values are 0 or 1.

If specified as 0, the component will attempt to create a symbolic link pointing to the data (typically a file name) specified by the LinkTarget parameter.

If specified as 1, the component will attempt to create a hard link pointing to the file name specified by the LinkTarget parameter. Note that in this case, the LinkTarget is either an absolute path on the server or a path relative to RemotePath. Please see below for a simple example.

nfs.ChangeRemotePath("/nfs"); // Create symlink.txt in /nfs pointing to existing_file.txt in the same directory nfs.CreateLink("symlink.txt", "existing_file.txt", 0); // Create hardlink.txt in /nfs pointing to existing_file.txt in the same directory nfs.CreateLink("hardlink.txt", "existing_file.txt", 1);

DeleteFile Method (NFSClient Component)

This method removes a file specified by FileName from the server.

Syntax

public void DeleteFile(string fileName);

Async Version
public async Task DeleteFile(string fileName);
public async Task DeleteFile(string fileName, CancellationToken cancellationToken);
Public Sub DeleteFile(ByVal FileName As String)

Async Version
Public Sub DeleteFile(ByVal FileName As String) As Task
Public Sub DeleteFile(ByVal FileName As String, cancellationToken As CancellationToken) As Task

Remarks

This method is used to remove a file specified by FileName from the server. The remote file or directory specified by FileName is deleted.

The FileName parameter is either an absolute path on the server, or a path relative to remote path set by ChangeRemotePath. For example:

// Delete test.txt in /home/test directory component.ChangeRemotePath("/home/test"); component.DeleteFile("test.txt"); // Alternatively... component.DeleteFile("/home/test/test.txt");

Disconnect Method (NFSClient Component)

This method disconnects from the NFS server.

Syntax

public void Disconnect();

Async Version
public async Task Disconnect();
public async Task Disconnect(CancellationToken cancellationToken);
Public Sub Disconnect()

Async Version
Public Sub Disconnect() As Task
Public Sub Disconnect(cancellationToken As CancellationToken) As Task

Remarks

This method is used to disconnect from the NFS server.

DoEvents Method (NFSClient Component)

This method processes events from the internal message queue.

Syntax

public void DoEvents();

Async Version
public async Task DoEvents();
public async Task DoEvents(CancellationToken cancellationToken);
Public Sub DoEvents()

Async Version
Public Sub DoEvents() As Task
Public Sub DoEvents(cancellationToken As CancellationToken) As Task

Remarks

The method checks for events to process, such as incoming data, and fires corresponding events as necessary. If there are no events to process, the method waits for a time specified by the SelectWaitMillis configuration setting before returning.

Windows: By default, the server socket uses Windows messages, and DoEvents dispatches Windows messages internally. It is not necessary to call DoEvents from Windows GUI applications as these applications have an internal message dispatch loop. When called, this method must be called in the same thread or task in which the StartListening and StopListening methods are called.

To avoid using Windows messages and a dispatch loop, set UseWindowsMessages to false. The application still needs to call this DoEvents method to let the component handle socket updates, but when Windows messages are not used, DoEvents and StopListening may be called from a separate thread or task.

Linux: The method may be called from any worker thread, and events will fire in this thread.

macOS: In GUI applications, it is not necessary to call this method as the component registers itself in the main message loop. In other applications, the method may be called from any worker thread, and events will fire in this thread.

Download Method (NFSClient Component)

This method downloads a remote file from the NFS server.

Syntax

public void Download();

Async Version
public async Task Download();
public async Task Download(CancellationToken cancellationToken);
Public Sub Download()

Async Version
Public Sub Download() As Task
Public Sub Download(cancellationToken As CancellationToken) As Task

Remarks

This method is used to download a remote file, specified by RemoteFile, from the NFS server.

The LocalFile property can be used to specify a local file to download the specified remote file to. If the LocalFile already exists and Overwrite is false, an error will occur.

Alternatively, the SetDownloadStream method can be called to download the file contents to the specified stream. In this case, calling SetDownloadStream will automatically reset the value of LocalFile.

As an alternative to setting LocalFile or calling SetDownloadStream, the downloaded file contents are also available in the Transfer event. Note that the downloaded data is always available via Transfer, regardless of whether the data is downloaded to a stream or file (or neither).

For example:

// Using LocalFile component.RemoteFile = "/home/test/test.txt"; component.LocalFile = "C:\\nfsdir\\test.txt"; component.Download(); // Using SetDownloadStream FileStream fs = new FileStream("C:\\nfsdir\\test.txt", FileMode.Open); component.RemoteFile = "/home/test/test.txt"; component.SetDownloadStream(fs); component.Download();

DownloadRange Method (NFSClient Component)

This method downloads a specific segment of a remote file from a NFS server.

Syntax

public int DownloadRange(string path, string fileName, long startByte, int count, byte[] buffer);

Async Version
public async Task<int> DownloadRange(string path, string fileName, long startByte, int count, byte[] buffer);
public async Task<int> DownloadRange(string path, string fileName, long startByte, int count, byte[] buffer, CancellationToken cancellationToken);
Public Function DownloadRange(ByVal Path As String, ByVal FileName As String, ByVal StartByte As Long, ByVal Count As Integer, ByVal Buffer As String) As Integer

Async Version
Public Function DownloadRange(ByVal Path As String, ByVal FileName As String, ByVal StartByte As Long, ByVal Count As Integer, ByVal Buffer As String) As Task(Of Integer)
Public Function DownloadRange(ByVal Path As String, ByVal FileName As String, ByVal StartByte As Long, ByVal Count As Integer, ByVal Buffer As String, cancellationToken As CancellationToken) As Task(Of Integer)

Remarks

This method is used to download a specific segment of a remote file specified by Path and FileName.

StartByte is the offset (in bytes) relative to the beginning of the file from where to start reading, and Count is the number of bytes to read into the specified Buffer.

This functionality is particularly useful for efficient management of large files and targeted data retrieval within them. This method will return the total number of bytes read into the buffer.

Note: If the requested range extends beyond the end of the file, only the available bytes will be returned.

For example:

// E.g., downloading first 5 bytes of file byte[] downloadBuffer = new byte[5]; component.DownloadRange("/home/test", "test.txt", 0, downloadBuffer.Length, downloadBuffer);

ListDirectory Method (NFSClient Component)

This method lists the current working directory on the NFS server.

Syntax

public void ListDirectory();

Async Version
public async Task ListDirectory();
public async Task ListDirectory(CancellationToken cancellationToken);
Public Sub ListDirectory()

Async Version
Public Sub ListDirectory() As Task
Public Sub ListDirectory(cancellationToken As CancellationToken) As Task

Remarks

This method is used to list the current working directory on the NFS server, as indicated by the current RemotePath.

The DirList event will fire for each entry in the current directory. The RemoteFile property may be used to specify a file mask for filtering the entries returned via DirList.

For example:

// List all text files in /home/test component.OnDirList += (o, e) => { Console.WriteLine("Dir Entry: " + e.FileName); }; component.ChangeRemotePath("/home/test"); component.RemoteFile = "*.txt"; component.ListDirectory();

Note: Because RemoteFile acts as a file mask, to retrieve a complete directory listing RemoteFile should be set to an empty string (or a mask like "*").

The following special characters are supported for pattern matching:

? Any single character.
* Any characters or no characters (e.g., C*t matches Cat, Cot, Coast, Ct).
[,-] A range of characters (e.g., [a-z], [a], [0-9], [0-9,a-d,f,r-z]).
\ The slash is ignored and exact matching is performed on the next character.

If these characters need to be used as a literal in a pattern, then they must be escaped by surrounding them with brackets []. Note: "]" and "-" do not need to be escaped. See below for the escape sequences:

CharacterEscape Sequence
? [?]
* [*]
[ [[]
\ [\]

For example, to match the value [Something].txt, specify the pattern [[]Something].txt.

MakeDirectory Method (NFSClient Component)

This method is used to create a directory on the NFS server.

Syntax

public void MakeDirectory(string newDir);

Async Version
public async Task MakeDirectory(string newDir);
public async Task MakeDirectory(string newDir, CancellationToken cancellationToken);
Public Sub MakeDirectory(ByVal NewDir As String)

Async Version
Public Sub MakeDirectory(ByVal NewDir As String) As Task
Public Sub MakeDirectory(ByVal NewDir As String, cancellationToken As CancellationToken) As Task

Remarks

This method is used to create a directory with a path specified by NewDir on the NFS server.

NewDir is either an absolute path on the server, or a path relative to the RemotePath that is set by calling ChangeRemotePath.

QueryFileAttributes Method (NFSClient Component)

This method queries the server for the file attributes of the specified RemoteFile

Syntax

public void QueryFileAttributes();

Async Version
public async Task QueryFileAttributes();
public async Task QueryFileAttributes(CancellationToken cancellationToken);
Public Sub QueryFileAttributes()

Async Version
Public Sub QueryFileAttributes() As Task
Public Sub QueryFileAttributes(cancellationToken As CancellationToken) As Task

Remarks

This method is used to query the server for file attributes of the specified RemoteFile. After calling this method, the FileAttributes property will be populated with the values returned by the server.

To update attributes, modify the desired values in FileAttributes and call UpdateFileAttributes. Please see below for a simple example:

// First, query attributes component.RemoteFile = "/home/test/test.txt"; component.QueryFileAttributes(); // Update OwnerId and OwnerGroupId of file component.FileAttributes.OwnerId = "1000"; component.FileAttributes.OwnerGroupId = "1000"; component.UpdateFileAttributes();

ReadLink Method (NFSClient Component)

Reads a symbolic link on the server.

This method is used to read a symbolic link on the server.

The LinkName parameter specifies the name of the symbolic link, and is either an absolute path on the server or a path relative to RemotePath.

This method will return a byte array containing the contents of the symbolic link as stored on the server. In NFS v4.0, the contents of a symbolic link are treated as opaque (binary data) at the protocol level. The server simply stores this opaque data, and returns this to the client when requested, meaning it is up to the client to interpret the link data.

Most of the time, the opaque data will represent the file the symbolic link is pointing to relative to the position of the symbolic link, meaning it can be converted to a UTF8 string representing this file. The contents of the file should then be downloaded by setting RemoteFile (and possibly RemotePath) accordingly and calling Download.

Please see below for a simple example of reading the contents of a symbolic link, and reading the file pointed to by the symbolic link.

nfs.ChangeRemotePath("/nfs"); // Create symlink.txt in /nfs pointing to existing_file.txt in the same directory nfs.CreateLink("symlink.txt", "existing_file.txt", 0); // Read link byte[] linkData = nfs.ReadLink("symlink.txt"); string file = Encoding.UTF8.GetString(linkData); nfs.RemoteFile = file; nfs.LocalFile = "temp.txt"; nfs.Download();

RemoveDirectory Method (NFSClient Component)

This removes a directory specified by DirName from the NFS server.

Syntax

public void RemoveDirectory(string dirName);

Async Version
public async Task RemoveDirectory(string dirName);
public async Task RemoveDirectory(string dirName, CancellationToken cancellationToken);
Public Sub RemoveDirectory(ByVal DirName As String)

Async Version
Public Sub RemoveDirectory(ByVal DirName As String) As Task
Public Sub RemoveDirectory(ByVal DirName As String, cancellationToken As CancellationToken) As Task

Remarks

This method is used to remove a directory with path specified by DirName from the NFS server. DirName is either an absolute path on the server, or a path relative to the RemotePath that is set by calling ChangeRemotePath.

RenameFile Method (NFSClient Component)

This changes the name of RemoteFile to NewName .

Syntax

public void RenameFile(string newName);

Async Version
public async Task RenameFile(string newName);
public async Task RenameFile(string newName, CancellationToken cancellationToken);
Public Sub RenameFile(ByVal NewName As String)

Async Version
Public Sub RenameFile(ByVal NewName As String) As Task
Public Sub RenameFile(ByVal NewName As String, cancellationToken As CancellationToken) As Task

Remarks

This method is used to change the name of a remote file, specified by RemoteFile, to NewName. RemoteFile and NewName are either absolute paths on the server, or a path relative to RemotePath that is set by calling ChangeRemotePath.

Reset Method (NFSClient Component)

This method will reset the component.

Syntax

public void Reset();

Async Version
public async Task Reset();
public async Task Reset(CancellationToken cancellationToken);
Public Sub Reset()

Async Version
Public Sub Reset() As Task
Public Sub Reset(cancellationToken As CancellationToken) As Task

Remarks

This method will reset the component's properties to their default values.

SetDownloadStream Method (NFSClient Component)

This method sets the stream to which the downloaded data from the server will be written.

Syntax

public void SetDownloadStream(System.IO.Stream downloadStream);

Async Version
public async Task SetDownloadStream(System.IO.Stream downloadStream);
public async Task SetDownloadStream(System.IO.Stream downloadStream, CancellationToken cancellationToken);
Public Sub SetDownloadStream(ByVal DownloadStream As System.IO.Stream)

Async Version
Public Sub SetDownloadStream(ByVal DownloadStream As System.IO.Stream) As Task
Public Sub SetDownloadStream(ByVal DownloadStream As System.IO.Stream, cancellationToken As CancellationToken) As Task

Remarks

This method is used to set the stream to which the downloaded data from the server will be written. If a download stream is set before the Download method is called, the downloaded data will be written to the stream. The stream should be open and normally set to position 0.

The component will automatically close this stream if CloseStreamAfterTransfer is True (default). If the stream is closed, you need to call SetDownloadStream again before calling Download again.

The downloaded content will be written starting at the current position in the stream. If StartByte is a non-zero value, the server will be instructed to skip those bytes before starting to send the content of the file. In that case, it is up to you to build the stream appropriately.

Note: SetDownloadStream will reset LocalFile.

SetUploadStream Method (NFSClient Component)

This method sets the stream from which the component will read data to upload to the server.

Syntax

public void SetUploadStream(System.IO.Stream uploadStream);

Async Version
public async Task SetUploadStream(System.IO.Stream uploadStream);
public async Task SetUploadStream(System.IO.Stream uploadStream, CancellationToken cancellationToken);
Public Sub SetUploadStream(ByVal UploadStream As System.IO.Stream)

Async Version
Public Sub SetUploadStream(ByVal UploadStream As System.IO.Stream) As Task
Public Sub SetUploadStream(ByVal UploadStream As System.IO.Stream, cancellationToken As CancellationToken) As Task

Remarks

This method is used to set the stream from which the component will read data to upload to the server. If an upload stream is set before the Upload method is called, the content of the stream will be read by the component and uploaded to the server. The stream should be open and normally set to position 0.

The component will automatically close this stream if CloseStreamAfterTransfer is True (default). If the stream is closed, you need to call SetUploadStream again before calling Upload again.

The content of the stream will be read from the current position all the way to the end, and no bytes will be skipped even if StartByte is set to a non-zero value (although the server will be instructed to skip those bytes in its file).

Note: SetUploadStream will reset LocalFile.

UpdateFileAttributes Method (NFSClient Component)

This method updates the FileAttributes for the current RemoteFile .

Syntax

public void UpdateFileAttributes();

Async Version
public async Task UpdateFileAttributes();
public async Task UpdateFileAttributes(CancellationToken cancellationToken);
Public Sub UpdateFileAttributes()

Async Version
Public Sub UpdateFileAttributes() As Task
Public Sub UpdateFileAttributes(cancellationToken As CancellationToken) As Task

Remarks

This method is used to update the FileAttributes for the current RemoteFile. After calling this method, the component will send any set FileAttributes to the server.

For example:

// First, query attributes component.RemoteFile = "/home/test/test.txt"; component.QueryFileAttributes(); // Update OwnerId and OwnerGroupId of file component.FileAttributes.OwnerId = "1000"; component.FileAttributes.OwnerGroupId = "1000"; component.UpdateFileAttributes();

Upload Method (NFSClient Component)

This method uploads a file to the NFS server.

Syntax

public void Upload();

Async Version
public async Task Upload();
public async Task Upload(CancellationToken cancellationToken);
Public Sub Upload()

Async Version
Public Sub Upload() As Task
Public Sub Upload(cancellationToken As CancellationToken) As Task

Remarks

This method is used to upload a file to the NFS server.

The RemoteFile property is used to specify the remote location to upload the local data to. If the RemoteFile already exists and Overwrite is false, an error will occur while uploading.

The LocalFile property can be used to specify a local file to upload to the specified remote location.

Alternatively, the SetUploadStream method can be called to upload the contents of a given stream. In this case, calling SetUploadStream will automatically reset the value of LocalFile.

The uploaded data will be made available in the Transfer event. Please see below for a simple example.

// Using LocalFile component.LocalFile = "C:\\nfsdir\\test.txt"; component.RemoteFile = "/home/test/test.txt"; component.Upload(); // Using SetDownloadStream FileStream fs = new FileStream("C:\\nfsdir\\test.txt", FileMode.Open); component.SetUploadStream(fs); component.RemoteFile = "/home/test/test.txt"; component.Upload();

UploadRange Method (NFSClient Component)

This method uploads a specific segment of data into a remote file on the NFS server.

Syntax

public void UploadRange(string path, string fileName, long startByte, int count, byte[] buffer);

Async Version
public async Task UploadRange(string path, string fileName, long startByte, int count, byte[] buffer);
public async Task UploadRange(string path, string fileName, long startByte, int count, byte[] buffer, CancellationToken cancellationToken);
Public Sub UploadRange(ByVal Path As String, ByVal FileName As String, ByVal StartByte As Long, ByVal Count As Integer, ByVal Buffer As String)

Async Version
Public Sub UploadRange(ByVal Path As String, ByVal FileName As String, ByVal StartByte As Long, ByVal Count As Integer, ByVal Buffer As String) As Task
Public Sub UploadRange(ByVal Path As String, ByVal FileName As String, ByVal StartByte As Long, ByVal Count As Integer, ByVal Buffer As String, cancellationToken As CancellationToken) As Task

Remarks

This method is used to upload a specific segment of data into a remote file specified by Path and FileName. Count bytes will be updated from the provided Buffer starting in the remote file at the StartByte offset.

This functionality enables precise control over the insertion of data into a remote file, allowing for targeted modifications, overwriting, or additions starting from a specific position within the file.

Note: If the offset specified is beyond the file length, empty bytes will be created between the last file byte and the uploaded buffer.

For example:

// E.g., appending data to EOF component.RemoteFile = "/home/test/test.txt"; component.QueryFileAttributes(); int startByte = component.FileAttributes.Size; byte[] buffer = Encoding.Default.GetBytes("Upload these bytes"); component.UploadRange("/home/test", "test.txt", startByte, buffer.Length, buffer);

Connected Event (NFSClient Component)

Fired immediately after a connection completes (or fails).

Syntax

public event OnConnectedHandler OnConnected;

public delegate void OnConnectedHandler(object sender, NFSClientConnectedEventArgs e);

public class NFSClientConnectedEventArgs : EventArgs {
  public int StatusCode { get; }
  public string Description { get; }
}
Public Event OnConnected As OnConnectedHandler

Public Delegate Sub OnConnectedHandler(sender As Object, e As NFSClientConnectedEventArgs)

Public Class NFSClientConnectedEventArgs Inherits EventArgs
  Public ReadOnly Property StatusCode As Integer
  Public ReadOnly Property Description As String
End Class

Remarks

If the connection is made normally, StatusCode is 0 and Description is "OK".

If the connection fails, StatusCode has the error code returned by the Transmission Control Protocol (TCP)/IP stack. Description contains a description of this code. The value of StatusCode is equal to the value of the error.

Please refer to the Error Codes section for more information.

DirList Event (NFSClient Component)

This event fires when a directory entry is received.

Syntax

public event OnDirListHandler OnDirList;

public delegate void OnDirListHandler(object sender, NFSClientDirListEventArgs e);

public class NFSClientDirListEventArgs : EventArgs {
  public string DirEntry { get; }
  public string FileName { get; }
  public bool IsDir { get; }
  public long FileSize { get; }
  public string FileTime { get; }
  public bool IsSymlink { get; }
}
Public Event OnDirList As OnDirListHandler

Public Delegate Sub OnDirListHandler(sender As Object, e As NFSClientDirListEventArgs)

Public Class NFSClientDirListEventArgs Inherits EventArgs
  Public ReadOnly Property DirEntry As String
  Public ReadOnly Property FileName As String
  Public ReadOnly Property IsDir As Boolean
  Public ReadOnly Property FileSize As Long
  Public ReadOnly Property FileTime As String
  Public ReadOnly Property IsSymlink As Boolean
End Class

Remarks

The DirList events are fired when a directory listing is received as a response to a ListDirectory call.

The StartTransfer and EndTransfer events mark the beginning and end of the event stream.

The DirEntry parameter contains the filename when ListDirectory is called and includes extended file information when ListDirectoryLong is called.

The component tries to fill out the FileName, IsDir, FileSize, and FileTime parameters when calling the ListDirectoryLong method. Except for FileName, these parameters are empty when a short "List Directory" is performed.

In Unix systems, the date is given in two types of formats: If the date is in the past 12 months the exact time is specified and the year is omitted. Otherwise, only the date and the year, but not hours or minutes, are given.

Disconnected Event (NFSClient Component)

This event is fired when a connection is closed.

Syntax

public event OnDisconnectedHandler OnDisconnected;

public delegate void OnDisconnectedHandler(object sender, NFSClientDisconnectedEventArgs e);

public class NFSClientDisconnectedEventArgs : EventArgs {
  public int StatusCode { get; }
  public string Description { get; }
}
Public Event OnDisconnected As OnDisconnectedHandler

Public Delegate Sub OnDisconnectedHandler(sender As Object, e As NFSClientDisconnectedEventArgs)

Public Class NFSClientDisconnectedEventArgs Inherits EventArgs
  Public ReadOnly Property StatusCode As Integer
  Public ReadOnly Property Description As String
End Class

Remarks

This event is fired when a connection is closed.

If the connection is broken normally, StatusCode is 0 and Description is "OK".

If the connection is broken for any other reason, StatusCode will be non-zero, and the Description parameter will contain a description of this code.

EndTransfer Event (NFSClient Component)

This event is fired when a file finishes uploading or downloading.

Syntax

public event OnEndTransferHandler OnEndTransfer;

public delegate void OnEndTransferHandler(object sender, NFSClientEndTransferEventArgs e);

public class NFSClientEndTransferEventArgs : EventArgs {
  public int Direction { get; }
}
Public Event OnEndTransfer As OnEndTransferHandler

Public Delegate Sub OnEndTransferHandler(sender As Object, e As NFSClientEndTransferEventArgs)

Public Class NFSClientEndTransferEventArgs Inherits EventArgs
  Public ReadOnly Property Direction As Integer
End Class

Remarks

This event is fired when a file is finished uploading or downloading.

This occurs when a file is finished transferring after calling Upload, UploadRange, Download, and DownloadRange.

The Direction parameter shows whether the client (0) or the server (1) is sending the data.

Error Event (NFSClient Component)

Fired when information is available about errors during data delivery.

Syntax

public event OnErrorHandler OnError;

public delegate void OnErrorHandler(object sender, NFSClientErrorEventArgs e);

public class NFSClientErrorEventArgs : EventArgs {
  public int ErrorCode { get; }
  public string Description { get; }
}
Public Event OnError As OnErrorHandler

Public Delegate Sub OnErrorHandler(sender As Object, e As NFSClientErrorEventArgs)

Public Class NFSClientErrorEventArgs Inherits EventArgs
  Public ReadOnly Property ErrorCode As Integer
  Public ReadOnly Property Description As String
End Class

Remarks

The Error event is fired in case of exceptional conditions during message processing. Normally the component throws an exception.

The ErrorCode parameter contains an error code, and the Description parameter contains a textual description of the error. For a list of valid error codes and their descriptions, please refer to the Error Codes section.

Log Event (NFSClient Component)

This event is fired once for each log message.

Syntax

public event OnLogHandler OnLog;

public delegate void OnLogHandler(object sender, NFSClientLogEventArgs e);

public class NFSClientLogEventArgs : EventArgs {
  public int LogLevel { get; }
  public string Message { get; }
  public string LogType { get; }
}
Public Event OnLog As OnLogHandler

Public Delegate Sub OnLogHandler(sender As Object, e As NFSClientLogEventArgs)

Public Class NFSClientLogEventArgs Inherits EventArgs
  Public ReadOnly Property LogLevel As Integer
  Public ReadOnly Property Message As String
  Public ReadOnly Property LogType As String
End Class

Remarks

This event fires once for each log message generated by the component. The verbosity is controlled by the LogLevel configuration.

LogLevel indicates the detail level of the message. Possible values are:

0 (None) No messages are logged.
1 (Info - Default) Informational events are logged.
2 (Verbose) Detailed data is logged.
3 (Debug) Debug data including all sent and received NFS operations are logged.

Message is the log message.

LogType identifies the type of log entry. Possible values are as follows:

  • NFS

StartTransfer Event (NFSClient Component)

This event is fired when a file starts uploading or downloading.

Syntax

public event OnStartTransferHandler OnStartTransfer;

public delegate void OnStartTransferHandler(object sender, NFSClientStartTransferEventArgs e);

public class NFSClientStartTransferEventArgs : EventArgs {
  public int Direction { get; }
}
Public Event OnStartTransfer As OnStartTransferHandler

Public Delegate Sub OnStartTransferHandler(sender As Object, e As NFSClientStartTransferEventArgs)

Public Class NFSClientStartTransferEventArgs Inherits EventArgs
  Public ReadOnly Property Direction As Integer
End Class

Remarks

This event is fired when a file starts uploading or downloading.

This occurs immediately before a file starts transferring after calling Upload, UploadRange, Download, and DownloadRange.

The Direction parameter shows whether the client (0) or the server (1) is sending the data.

Transfer Event (NFSClient Component)

This event is fired during the file download or upload.

Syntax

public event OnTransferHandler OnTransfer;

public delegate void OnTransferHandler(object sender, NFSClientTransferEventArgs e);

public class NFSClientTransferEventArgs : EventArgs {
  public int Direction { get; }
  public long BytesTransferred { get; }
  public int PercentDone { get; }
  public string Text { get; }
public byte[] TextB { get; } }
Public Event OnTransfer As OnTransferHandler

Public Delegate Sub OnTransferHandler(sender As Object, e As NFSClientTransferEventArgs)

Public Class NFSClientTransferEventArgs Inherits EventArgs
  Public ReadOnly Property Direction As Integer
  Public ReadOnly Property BytesTransferred As Long
  Public ReadOnly Property PercentDone As Integer
  Public ReadOnly Property Text As String
Public ReadOnly Property TextB As Byte() End Class

Remarks

One or more Transfer events are fired during file transfer. The BytesTransferred parameter shows the number of bytes transferred since the beginning of the transfer.

Text contains the portion of the file data being delivered.

The Direction parameter shows whether the client (0) or the server (1) is sending the data.

The PercentDone parameter shows the progress of the transfer in the corresponding direction. If PercentDone can not be calculated the value will be -1.

Note: Events are not re-entrant. Performing time-consuming operations within this event will prevent it from firing again in a timely manner and may affect overall performance.

Firewall Type

The firewall the component will connect through.

Remarks

When connecting through a firewall, this type is used to specify different properties of the firewall, such as the firewall Host and the FirewallType.

The following fields are available:

Fields

AutoDetect
bool

Default: False

Whether to automatically detect and use firewall system settings, if available.

FirewallType
FirewallTypes

Default: 0

The type of firewall to connect through. The applicable values are as follows:

fwNone (0)No firewall (default setting).
fwTunnel (1)Connect through a tunneling proxy. Port is set to 80.
fwSOCKS4 (2)Connect through a SOCKS4 Proxy. Port is set to 1080.
fwSOCKS5 (3)Connect through a SOCKS5 Proxy. Port is set to 1080.
fwSOCKS4A (10)Connect through a SOCKS4A Proxy. Port is set to 1080.

Host
string

Default: ""

The name or IP address of the firewall (optional). If a Host is given, the requested connections will be authenticated through the specified firewall when connecting.

If this field is set to a Domain Name, a DNS request is initiated. Upon successful termination of the request, this field is set to the corresponding address. If the search is not successful, the component throws an exception.

Password
string

Default: ""

A password if authentication is to be used when connecting through the firewall. If Host is specified, the User and Password fields are used to connect and authenticate to the given firewall. If the authentication fails, the component throws an exception.

Port
int

Default: 0

The Transmission Control Protocol (TCP) port for the firewall Host. See the description of the Host field for details.

Note: This field is set automatically when FirewallType is set to a valid value. See the description of the FirewallType field for details.

User
string

Default: ""

A username if authentication is to be used when connecting through a firewall. If Host is specified, this field and the Password field are used to connect and authenticate to the given Firewall. If the authentication fails, the component throws an exception.

Constructors

public Firewall();
Public Firewall()

NFSFileAttributes Type

Includes a set of attributes for a file existing on an Network File System (NFS) server.

Remarks

This type describes a file residing on an SFTP server.

The following fields are available:

Fields

AccessTime
long

Default: 0

Contains the number of seconds since 12:00:00 AM, January 1, 1970, when this file was last accessed.

AccessTimeNanos
int

Default: 0

Contains a subsecond value associated with this file's AccessTime.

AllocationSize
long (read-only)

Default: 0

Number of file system bytes allocated to this file object.

CreationTime
long (read-only)

Default: 0

Specifies the number of seconds since 12:00:00 AM, January 1, 1970, when this file was created.

CreationTimeNanos
int (read-only)

Default: 0

Contains a subsecond value associated with this file's CreationTime.

FileType
NFSFileTypes (read-only)

Default: 0

The type of file. FileType may be one of the following values:

1 (nfsREG - default)A regular file.
2 (NFS4DIR)A directory.
3 (NF4BLK)The file is a block device special file.
4 (NF4CHR)The file type is a character device special file.
5 (NF4LNK)The file type is a symbolic link.
6 (NF4SOCK)The file handle is a named socket special file.
7 (NF4FIFO)The file handle is a fifo special file.
8 (NF4ATTRDIR)The file handle is a named attribute directory.
9 (NF4NAMEDATTR)The file handle is a named attribute.

IsDir
bool (read-only)

Default: False

Specifies whether or not the file represented by these attributes is a directory.

IsSymlink
bool (read-only)

Default: False

Specifies whether or not the file or directory represented by these attributes is a symbolic link.

LinkCount
int (read-only)

Default: 0

Number of hard links to this object.

MIMEType
string (read-only)

Default: ""

Specifies a value that can be used in the Content-Type header for a MIME entity part containing this file.

Mode
int

Default: 0

Mode of a file

ModifiedTime
long

Default: 0

Specifies the number of seconds since 12:00:00 AM, January 1, 1970, that this file was last modified.

ModifiedTimeNanos
int

Default: 0

Includes a subsecond value associated with this file's ModifiedTime.

OwnerGroupId
string

Default: ""

The string name of the group ownership of this object.

OwnerId
string

Default: ""

The string name of the owner of this object.

Size
long

Default: 0

Specifies the total size, in bytes, of this file.

Config Settings (NFSClient Component)

The component accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the component, access to these internal properties is provided through the Config method.

NfsClient Config Settings

AppendToLocalFile:   Whether to append downloaded files to a local file.

This config specifies whether to append downloaded files to a local file. By default, this is False. If set to True, the downloaded files will be appended to the file specified by LocalFile.

ClientIDSeek:   Specifies some identifier used when creating the client ID associated with the current connection.

This config is used to specify some identifier used when creating the client ID associated with the current connection. By default, this is set to an empty string.

To clarify, when connecting to a server, the client must send a client ID to identify itself. The component automatically creates an ID based on the LocalHost, LocalPort, RemoteHost, and RemotePort, as recommended by RFC 7530.

This could cause problems on the server-side if multiple clients are running on the exact same machine, or by chance have the same client ID. If this is the case, this config can be set to some unique string identifier for the client, which will be appended to the existing client ID, to ensure no server-side collisions.

DirCountSize:   Specifies the maximum number of bytes that may be returned in a single READDIR request.

This config specifies the maximum number of bytes that may be returned in a single READDIR request. By default, this config is set to 4096 bytes.

When calling ListDirectory, this config is utilized to inform the server of the maximum number of bytes that should be returned in a single READDIR request.

Larger values will result in fewer READDIR requests for the given ListDirectory operation, but the READDIR results from the server-side could potentially be much larger. Smaller values will result in smaller READDIR responses from the server, but increase the frequency of READDIR requests to the server.

FileTimeFormat:   Specifies the format to use when returning filetime strings.

This config specifies the format to use when returning filetime strings. If specified, the component will use this value to format the filetime string returned through the DirList event. By default, the component will format the date as "MM/dd/yyyy HH:mm:ss".

MaxReadBytes:   Indicates the maximum number of bytes that will be returned in one READ operation.

This config indicates the maximum number of bytes that will be returned in one READ operation when downloading a file.

Note this config is read-only.

MaxWriteBytes:   Indicates the maximum number of bytes that will be written in one WRITE operation.

This config indicates the maximum number of bytes that will be written in one WRITE operation when uploading a file.

Note this config is read-only.

OpenOwner:   Specifies an opaque string representing the client when opening a file.

This config specifies an opaque string representing the client when opening a file (e.g., for reading or writing to the file). The server utilizes this value to manage OPEN requests from multiple clients.

By default, this config is an empty string. It is automatically assigned upon the clients first read or write operation (e.g., via Upload or Download). Upon the first read or write operation, the component sets this value to the number of milliseconds elapsed since the epoch (January 1, 1970 UTC), and it remains unchanged for the lifetime of the client. In most cases, it is not necessary to set this config.

RPCAuxiliaryGids:   Specifies the Auxiliary GIDs (or groups) the client is a part of.

This config is used to specify the Auxiliary GIDs (or groups) the client is a part, which will be utilized during RPC requests to the remote host.

This config must be specified as a comma-separated list of such GIDs, for example: 4,24,27,30,46,110,1000

RPCHostname:   Specifies the host (or machine) name of the client.

This config is used to specify the host (or machine) name of the client, which will be utilized during RPC requests to the remote host.

STMask:   Specifies the default file mode (or permission) bits to exclude when creating a file.

This config specifies the default file mode (or permission) bits to exclude when creating a file. This config is applicable when calling CreateFile, CreateLink, MakeDirectory, Upload, and UploadRange.

By default, this is set to the ORed value of S_IWGRP and S_IWOTH, meaning the new file will not include write permissions for the group or others. For reference, this config may be set to a combination of the following permission bits, as defined in the UNIX standard sys/stat.h header:

S_IRUSR0x100Read permission, owner.
S_IWUSR0x080Write permission, owner.
S_IXUSR0x040Execute permission, owner.
S_IRGRP0x020Read permission, group.
S_IWGRP0x010Write permission, group.
S_IXGRP0x008Execute permission, group.
S_IROTH0x004Read permission, others.
S_IWOTH0x002Write permission, others.
S_IXOTH0x001Execute permission, others.

For example, to deny write permissions only for others, you can set this like so:

int stMask = S_IWOTH; // 0x0002 component.Config("STMask=" + stMask); component.Remotefile = "remote.txt"; component.CreateFile();

UsePlatformKerberosAPI:   Whether to use the platform Kerberos API.

This config determines whether or not to use the platform Kerberos API when connecting (and assuming SecurityMechanism is set to krb5, krb5i, or krb5p). By default, the component does not rely on any platform APIs to perform Kerberos authentication, and this config is False. Use of the platform API may be enabled by setting this to True.

Note: This functionality is only available on Windows.

XAttrCountSize:   Specifies the maximum number of bytes that may be returned in a single LISTXATTRS request.

This config specifies the maximum number of data retrieved from the NFSServer when the client requests to list the XAttributes of a remoteFile.

Base Config Settings

BuildInfo:   Information about the product's build.

When queried, this setting will return a string containing information about the product's build.

GUIAvailable:   Whether or not a message loop is available for processing events.

In a GUI-based application, long-running blocking operations may cause the application to stop responding to input until the operation returns. The component will attempt to discover whether or not the application has a message loop and, if one is discovered, it will process events in that message loop during any such blocking operation.

In some non-GUI applications, an invalid message loop may be discovered that will result in errant behavior. In these cases, setting GUIAvailable to false will ensure that the component does not attempt to process external events.

LicenseInfo:   Information about the current license.

When queried, this setting will return a string containing information about the license this instance of a component is using. It will return the following information:

  • Product: The product the license is for.
  • Product Key: The key the license was generated from.
  • License Source: Where the license was found (e.g., RuntimeLicense, License File).
  • License Type: The type of license installed (e.g., Royalty Free, Single Server).
  • Last Valid Build: The last valid build number for which the license will work.
MaskSensitiveData:   Whether sensitive data is masked in log messages.

In certain circumstances it may be beneficial to mask sensitive data, like passwords, in log messages. Set this to true to mask sensitive data. The default is true.

This setting only works on these components: AS3Receiver, AS3Sender, Atom, Client(3DS), FTP, FTPServer, IMAP, OFTPClient, SSHClient, SCP, Server(3DS), Sexec, SFTP, SFTPServer, SSHServer, TCPClient, TCPServer.

UseInternalSecurityAPI:   Whether or not to use the system security libraries or an internal implementation.

When set to false, the component will use the system security libraries by default to perform cryptographic functions where applicable. In this case, calls to unmanaged code will be made. In certain environments, this is not desirable. To use a completely managed security implementation, set this setting to true.

Setting this configuration setting to true tells the component to use the internal implementation instead of using the system security libraries.

On Windows, this setting is set to false by default. On Linux/macOS, this setting is set to true by default.

If using the .NET Standard Library, this setting will be true on all platforms. The .NET Standard library does not support using the system security libraries.

Note: This setting is static. The value set is applicable to all components used in the application.

When this value is set, the product's system dynamic link library (DLL) is no longer required as a reference, as all unmanaged code is stored in that file.

Trappable Errors (NFSClient Component)

NFSCLIENT Errors

500   Invalid state error. Please see the error description for further details.
550   An unsupported attribute was encountered.
551   An error was encountered changing the remote path.
553   The remote file could not be found before performing an upload or download operation.
554   The local file could not be found before performing an upload or download operation.
555   The current upload or download was manually aborted.
557   When manually uploading or downloading a specified range, the buffer specified was empty or null.
558   When manually uploading or downloading a specified range, the starting byte or count was negative.
559   When manually uploading or downloading a specified range, the count was greater than the size of the buffer.
560   When downloading, this indicates the local file exists and the Overwrite property is false.
561   An invalid link option was specified when creating a link. Only values of 0 (symbolic link) and 1 (hard link) are supported.
562   When uploading, this indicates the local file could not be found.
567   When uploading, this indicates an error occurred opening the local file.
568   When uploading, this indicates an error occurred while skipping the starting bytes of the local file.
569   An error was encountered while uploading a file. Please see the error description for more details.
570   An error was encountered while downloading a file. Please see the error description for more details.