NFSClient Class
Properties Methods Events Config Settings Errors
This class is used to create a Network File System (NFS) client based on NFS version 4.0.
Syntax
NFSClient
Remarks
This class 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 classes perspective, /.
If the server exports a specific directory (e.g., /mnt/mynfs), the class 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:
Mechanism | Description |
none | No authentication is required to establish a connection to the server (AUTH_NONE or AUTH_NULL). |
sys | System authentication is required to establish a connection to the server (AUTH_SYS or AUTH_UNIX). |
krb5 | Kerberos v5 with client authentication only. |
krb5i | Kerberos v5 with client authentication and integrity protection. |
krb5p | Kerberos 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 class 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 classes 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 class 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 class 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 class 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 class 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 class 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 class 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 class 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 class with short descriptions. Click on the links for further details.
Connected | Whether the class is connected. |
FileAttributes | The attributes of the RemoteFile . |
Firewall | A set of properties related to firewall access. |
KDCHost | Specifies domain name or IP address of the Key Distribution Center (KDC). |
KDCPort | Specifies the port for the Key Distribution Center (KDC). |
KeytabFile | Specifies the path to the Kerberos Keytab file. |
LocalFile | This is the path to a local file for download or upload. If the file exists, it is overwritten. |
LocalHost | The name of the local host or user-assigned IP interface through which connections are initiated or accepted. |
LocalPort | The TCP port in the local host where the class binds. |
Overwrite | This indicates whether the class should overwrite the local or remote file during a download or upload. |
Password | Specifies the password of the User to authenticate. |
RemoteFile | This is the name of the remote file for uploading, downloading, and performing other operations. |
RemoteHost | Specifies the address of the NFS server. |
RemotePath | Specifies the current path in the NFS server. |
RemotePort | Specifies the port the NFS server is listening on. |
RPCGid | Specifies the group identifier (GID) associated with requests during RPC system authentication. |
RPCUid | Specifies the user identifier (UID) associated with requests during RPC system authentication. |
SecurityMechanism | Specifies the RPC security mechanism the client should use when connecting to the NFS Server. |
SPN | Specifies the Service Principal Name (SPN). |
StartByte | The offset in bytes at which to begin the Upload or Download. |
Timeout | This property includes the timeout for the class. |
User | Specifies the name and domain of the user to authenticate. |
Method List
The following is the full list of the methods of the class with short descriptions. Click on the links for further details.
Abort | Aborts the current upload or download. |
Append | Appends data from LocalFile to a remote file RemoteFile on a NFS server. |
ChangeRemotePath | Changes the current path on the server. |
CheckFileExists | Checks whether the file specified by RemoteFile exists on the server. |
Config | Sets or retrieves a configuration setting. |
Connect | This method connects to the NFS server. |
CreateFile | Creates a file on the NFS server. |
CreateLink | Creates a hard link or symbolic link on the server. |
DeleteFile | This method removes a file specified by FileName from the server. |
Disconnect | This method disconnects from the NFS server. |
DoEvents | This method processes events from the internal message queue. |
Download | This method downloads a remote file from the NFS server. |
DownloadRange | This method downloads a specific segment of a remote file from a NFS server. |
ListDirectory | This method lists the current working directory on the NFS server. |
MakeDirectory | This method is used to create a directory on the NFS server. |
QueryFileAttributes | This method queries the server for the file attributes of the specified RemoteFile . |
ReadLink | Reads a symbolic link on the server. |
RemoveDirectory | This removes a directory specified by DirName from the NFS server. |
RenameFile | This changes the name of RemoteFile to NewName . |
Reset | This method will reset the class. |
SetDownloadStream | This method sets the stream to which the downloaded data from the server will be written. |
SetUploadStream | This method sets the stream from which the class will read data to upload to the server. |
UpdateFileAttributes | This method updates the FileAttributes for the current RemoteFile . |
Upload | This method uploads a file to the NFS server. |
UploadRange | This 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 class with short descriptions. Click on the links for further details.
Connected | Fired immediately after a connection completes (or fails). |
DirList | This event fires when a directory entry is received. |
Disconnected | This event is fired when a connection is closed. |
EndTransfer | This event is fired when a file finishes uploading or downloading. |
Error | Fired when information is available about errors during data delivery. |
Log | This event is fired once for each log message. |
StartTransfer | This event is fired when a file starts uploading or downloading. |
Transfer | This event is fired during the file download or upload. |
Config Settings
The following is a list of config settings for the class with short descriptions. Click on the links for further details.
AppendToLocalFile | Whether to append downloaded files to a local file. |
ClientIDSeek | Specifies some identifier used when creating the client ID associated with the current connection. |
DirCountSize | Specifies the maximum number of bytes that may be returned in a single READDIR request. |
FileTimeFormat | Specifies the format to use when returning filetime strings. |
MaxReadBytes | Indicates the maximum number of bytes that will be returned in one READ operation. |
MaxWriteBytes | Indicates the maximum number of bytes that will be written in one WRITE operation. |
OpenOwner | Specifies an opaque string representing the client when opening a file. |
RPCAuxiliaryGids | Specifies the Auxiliary GIDs (or groups) the client is a part of. |
RPCHostname | Specifies the host (or machine) name of the client. |
STMask | Specifies the default file mode (or permission) bits to exclude when creating a file. |
UsePlatformKerberosAPI | Whether to use the platform Kerberos API. |
XAttrCountSize | Specifies the maximum number of bytes that may be returned in a single LISTXATTRS request. |
BuildInfo | Information about the product's build. |
CodePage | The system code page used for Unicode to Multibyte translations. |
LicenseInfo | Information about the current license. |
MaskSensitiveData | Whether sensitive data is masked in log messages. |
ProcessIdleEvents | Whether the class uses its internal event loop to process events when the main thread is idle. |
SelectWaitMillis | The length of time in milliseconds the class will wait when DoEvents is called if there are no events to process. |
UseInternalSecurityAPI | Whether or not to use the system security libraries or an internal implementation. |
Connected Property (NFSClient Class)
Whether the class is connected.
Syntax
ANSI (Cross Platform) int GetConnected(); Unicode (Windows) BOOL GetConnected();
int nfssdk_nfsclient_getconnected(void* lpObj);
bool GetConnected();
Default Value
FALSE
Remarks
This property is used to determine whether or not the class 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.
Data Type
Boolean
FileAttributes Property (NFSClient Class)
The attributes of the RemoteFile .
Syntax
NFSSDKNFSFileAttributes* GetFileAttributes(); int SetFileAttributes(NFSSDKNFSFileAttributes* val);
int64 nfssdk_nfsclient_getfileaccesstime(void* lpObj);
int nfssdk_nfsclient_setfileaccesstime(void* lpObj, int64 lFileAccessTime);
int nfssdk_nfsclient_getfileaccesstimenanos(void* lpObj);
int nfssdk_nfsclient_setfileaccesstimenanos(void* lpObj, int iFileAccessTimeNanos);
int64 nfssdk_nfsclient_getfileallocationsize(void* lpObj);
int64 nfssdk_nfsclient_getfilecreationtime(void* lpObj);
int nfssdk_nfsclient_getfilecreationtimenanos(void* lpObj);
int nfssdk_nfsclient_getfiletype(void* lpObj);
int nfssdk_nfsclient_getfileisdir(void* lpObj);
int nfssdk_nfsclient_getfileissymlink(void* lpObj);
int nfssdk_nfsclient_getfilelinkcount(void* lpObj);
char* nfssdk_nfsclient_getfilemimetype(void* lpObj);
int nfssdk_nfsclient_getfilemode(void* lpObj);
int nfssdk_nfsclient_setfilemode(void* lpObj, int iFileMode);
int64 nfssdk_nfsclient_getfilemodifiedtime(void* lpObj);
int nfssdk_nfsclient_setfilemodifiedtime(void* lpObj, int64 lFileModifiedTime);
int nfssdk_nfsclient_getfilemodifiedtimenanos(void* lpObj);
int nfssdk_nfsclient_setfilemodifiedtimenanos(void* lpObj, int iFileModifiedTimeNanos);
char* nfssdk_nfsclient_getfileownergroupid(void* lpObj);
int nfssdk_nfsclient_setfileownergroupid(void* lpObj, const char* lpszFileOwnerGroupId);
char* nfssdk_nfsclient_getfileownerid(void* lpObj);
int nfssdk_nfsclient_setfileownerid(void* lpObj, const char* lpszFileOwnerId);
int64 nfssdk_nfsclient_getfilesize(void* lpObj);
int nfssdk_nfsclient_setfilesize(void* lpObj, int64 lFileSize);
qint64 GetFileAccessTime();
int SetFileAccessTime(qint64 lFileAccessTime); int GetFileAccessTimeNanos();
int SetFileAccessTimeNanos(int iFileAccessTimeNanos); qint64 GetFileAllocationSize(); qint64 GetFileCreationTime(); int GetFileCreationTimeNanos(); int GetFileType(); bool GetFileIsDir(); bool GetFileIsSymlink(); int GetFileLinkCount(); QString GetFileMIMEType(); int GetFileMode();
int SetFileMode(int iFileMode); qint64 GetFileModifiedTime();
int SetFileModifiedTime(qint64 lFileModifiedTime); int GetFileModifiedTimeNanos();
int SetFileModifiedTimeNanos(int iFileModifiedTimeNanos); QString GetFileOwnerGroupId();
int SetFileOwnerGroupId(QString qsFileOwnerGroupId); QString GetFileOwnerId();
int SetFileOwnerId(QString qsFileOwnerId); qint64 GetFileSize();
int SetFileSize(qint64 lFileSize);
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.
Data Type
Firewall Property (NFSClient Class)
A set of properties related to firewall access.
Syntax
NFSSDKFirewall* GetFirewall(); int SetFirewall(NFSSDKFirewall* val);
int nfssdk_nfsclient_getfirewallautodetect(void* lpObj);
int nfssdk_nfsclient_setfirewallautodetect(void* lpObj, int bFirewallAutoDetect);
int nfssdk_nfsclient_getfirewalltype(void* lpObj);
int nfssdk_nfsclient_setfirewalltype(void* lpObj, int iFirewallType);
char* nfssdk_nfsclient_getfirewallhost(void* lpObj);
int nfssdk_nfsclient_setfirewallhost(void* lpObj, const char* lpszFirewallHost);
char* nfssdk_nfsclient_getfirewallpassword(void* lpObj);
int nfssdk_nfsclient_setfirewallpassword(void* lpObj, const char* lpszFirewallPassword);
int nfssdk_nfsclient_getfirewallport(void* lpObj);
int nfssdk_nfsclient_setfirewallport(void* lpObj, int iFirewallPort);
char* nfssdk_nfsclient_getfirewalluser(void* lpObj);
int nfssdk_nfsclient_setfirewalluser(void* lpObj, const char* lpszFirewallUser);
bool GetFirewallAutoDetect();
int SetFirewallAutoDetect(bool bFirewallAutoDetect); int GetFirewallType();
int SetFirewallType(int iFirewallType); QString GetFirewallHost();
int SetFirewallHost(QString qsFirewallHost); QString GetFirewallPassword();
int SetFirewallPassword(QString qsFirewallPassword); int GetFirewallPort();
int SetFirewallPort(int iFirewallPort); QString GetFirewallUser();
int SetFirewallUser(QString qsFirewallUser);
Remarks
This is a Firewall-type property, which contains fields describing the firewall through which the class will attempt to connect.
Data Type
KDCHost Property (NFSClient Class)
Specifies domain name or IP address of the Key Distribution Center (KDC).
Syntax
ANSI (Cross Platform) char* GetKDCHost();
int SetKDCHost(const char* lpszKDCHost); Unicode (Windows) LPWSTR GetKDCHost();
INT SetKDCHost(LPCWSTR lpszKDCHost);
char* nfssdk_nfsclient_getkdchost(void* lpObj);
int nfssdk_nfsclient_setkdchost(void* lpObj, const char* lpszKDCHost);
QString GetKDCHost();
int SetKDCHost(QString qsKDCHost);
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.
Data Type
String
KDCPort Property (NFSClient Class)
Specifies the port for the Key Distribution Center (KDC).
Syntax
ANSI (Cross Platform) int GetKDCPort();
int SetKDCPort(int iKDCPort); Unicode (Windows) INT GetKDCPort();
INT SetKDCPort(INT iKDCPort);
int nfssdk_nfsclient_getkdcport(void* lpObj);
int nfssdk_nfsclient_setkdcport(void* lpObj, int iKDCPort);
int GetKDCPort();
int SetKDCPort(int iKDCPort);
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.
Data Type
Integer
KeytabFile Property (NFSClient Class)
Specifies the path to the Kerberos Keytab file.
Syntax
ANSI (Cross Platform) char* GetKeytabFile();
int SetKeytabFile(const char* lpszKeytabFile); Unicode (Windows) LPWSTR GetKeytabFile();
INT SetKeytabFile(LPCWSTR lpszKeytabFile);
char* nfssdk_nfsclient_getkeytabfile(void* lpObj);
int nfssdk_nfsclient_setkeytabfile(void* lpObj, const char* lpszKeytabFile);
QString GetKeytabFile();
int SetKeytabFile(QString qsKeytabFile);
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.
Data Type
String
LocalFile Property (NFSClient Class)
This is the path to a local file for download or upload. If the file exists, it is overwritten.
Syntax
ANSI (Cross Platform) char* GetLocalFile();
wchar_t* GetLocalFile_W(); // Windows only
int SetLocalFile(const char* lpszLocalFile);
int SetLocalFile(const wchar_t* lpszLocalFile); // Windows only Unicode (Windows) LPWSTR GetLocalFile();
INT SetLocalFile(LPCWSTR lpszLocalFile);
char* nfssdk_nfsclient_getlocalfile(void* lpObj);
wchar_t* nfssdk_nfsclient_getlocalfile_W(void* lpObj); // Windows only
int nfssdk_nfsclient_setlocalfile(void* lpObj, const char* lpszLocalFile);
int nfssdk_nfsclient_setlocalfile(void* lpObj, const wchar_t* lpszLocalFile); // Windows only
QString GetLocalFile();
int SetLocalFile(QString qsLocalFile);
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();
Data Type
String
LocalHost Property (NFSClient Class)
The name of the local host or user-assigned IP interface through which connections are initiated or accepted.
Syntax
ANSI (Cross Platform) char* GetLocalHost();
int SetLocalHost(const char* lpszLocalHost); Unicode (Windows) LPWSTR GetLocalHost();
INT SetLocalHost(LPCWSTR lpszLocalHost);
char* nfssdk_nfsclient_getlocalhost(void* lpObj);
int nfssdk_nfsclient_setlocalhost(void* lpObj, const char* lpszLocalHost);
QString GetLocalHost();
int SetLocalHost(QString qsLocalHost);
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 class initiate connections (or accept in the case of server classs) 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 class 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.
Data Type
String
LocalPort Property (NFSClient Class)
The TCP port in the local host where the class binds.
Syntax
ANSI (Cross Platform) int GetLocalPort();
int SetLocalPort(int iLocalPort); Unicode (Windows) INT GetLocalPort();
INT SetLocalPort(INT iLocalPort);
int nfssdk_nfsclient_getlocalport(void* lpObj);
int nfssdk_nfsclient_setlocalport(void* lpObj, int iLocalPort);
int GetLocalPort();
int SetLocalPort(int iLocalPort);
Default Value
0
Remarks
This property must be set before a connection is attempted. It instructs the class 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.
Data Type
Integer
Overwrite Property (NFSClient Class)
This indicates whether the class should overwrite the local or remote file during a download or upload.
Syntax
ANSI (Cross Platform) int GetOverwrite();
int SetOverwrite(int bOverwrite); Unicode (Windows) BOOL GetOverwrite();
INT SetOverwrite(BOOL bOverwrite);
int nfssdk_nfsclient_getoverwrite(void* lpObj);
int nfssdk_nfsclient_setoverwrite(void* lpObj, int bOverwrite);
bool GetOverwrite();
int SetOverwrite(bool bOverwrite);
Default Value
FALSE
Remarks
This property indicates whether the class 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.
Data Type
Boolean
Password Property (NFSClient Class)
Specifies the password of the User to authenticate.
Syntax
ANSI (Cross Platform) char* GetPassword();
int SetPassword(const char* lpszPassword); Unicode (Windows) LPWSTR GetPassword();
INT SetPassword(LPCWSTR lpszPassword);
char* nfssdk_nfsclient_getpassword(void* lpObj);
int nfssdk_nfsclient_setpassword(void* lpObj, const char* lpszPassword);
QString GetPassword();
int SetPassword(QString qsPassword);
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.
Data Type
String
RemoteFile Property (NFSClient Class)
This is the name of the remote file for uploading, downloading, and performing other operations.
Syntax
ANSI (Cross Platform) char* GetRemoteFile();
int SetRemoteFile(const char* lpszRemoteFile); Unicode (Windows) LPWSTR GetRemoteFile();
INT SetRemoteFile(LPCWSTR lpszRemoteFile);
char* nfssdk_nfsclient_getremotefile(void* lpObj);
int nfssdk_nfsclient_setremotefile(void* lpObj, const char* lpszRemoteFile);
QString GetRemoteFile();
int SetRemoteFile(QString qsRemoteFile);
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:
Character | Escape Sequence |
? | [?] |
* | [*] |
[ | [[] |
\ | [\] |
For example, to match the value [Something].txt, specify the pattern [[]Something].txt.
Data Type
String
RemoteHost Property (NFSClient Class)
Specifies the address of the NFS server.
Syntax
ANSI (Cross Platform) char* GetRemoteHost();
int SetRemoteHost(const char* lpszRemoteHost); Unicode (Windows) LPWSTR GetRemoteHost();
INT SetRemoteHost(LPCWSTR lpszRemoteHost);
char* nfssdk_nfsclient_getremotehost(void* lpObj);
int nfssdk_nfsclient_setremotehost(void* lpObj, const char* lpszRemoteHost);
QString GetRemoteHost();
int SetRemoteHost(QString qsRemoteHost);
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.
Data Type
String
RemotePath Property (NFSClient Class)
Specifies the current path in the NFS server.
Syntax
ANSI (Cross Platform) char* GetRemotePath(); Unicode (Windows) LPWSTR GetRemotePath();
char* nfssdk_nfsclient_getremotepath(void* lpObj);
QString GetRemotePath();
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.
Data Type
String
RemotePort Property (NFSClient Class)
Specifies the port the NFS server is listening on.
Syntax
ANSI (Cross Platform) int GetRemotePort();
int SetRemotePort(int iRemotePort); Unicode (Windows) INT GetRemotePort();
INT SetRemotePort(INT iRemotePort);
int nfssdk_nfsclient_getremoteport(void* lpObj);
int nfssdk_nfsclient_setremoteport(void* lpObj, int iRemotePort);
int GetRemotePort();
int SetRemotePort(int iRemotePort);
Default Value
2049
Remarks
This property specifies the port the NFS server is listening on (i.e., the port the class 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.
Data Type
Integer
RPCGid Property (NFSClient Class)
Specifies the group identifier (GID) associated with requests during RPC system authentication.
Syntax
ANSI (Cross Platform) int GetRPCGid();
int SetRPCGid(int iRPCGid); Unicode (Windows) INT GetRPCGid();
INT SetRPCGid(INT iRPCGid);
int nfssdk_nfsclient_getrpcgid(void* lpObj);
int nfssdk_nfsclient_setrpcgid(void* lpObj, int iRPCGid);
int GetRPCGid();
int SetRPCGid(int iRPCGid);
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.
Data Type
Integer
RPCUid Property (NFSClient Class)
Specifies the user identifier (UID) associated with requests during RPC system authentication.
Syntax
ANSI (Cross Platform) int GetRPCUid();
int SetRPCUid(int iRPCUid); Unicode (Windows) INT GetRPCUid();
INT SetRPCUid(INT iRPCUid);
int nfssdk_nfsclient_getrpcuid(void* lpObj);
int nfssdk_nfsclient_setrpcuid(void* lpObj, int iRPCUid);
int GetRPCUid();
int SetRPCUid(int iRPCUid);
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.
Data Type
Integer
SecurityMechanism Property (NFSClient Class)
Specifies the RPC security mechanism the client should use when connecting to the NFS Server.
Syntax
ANSI (Cross Platform) char* GetSecurityMechanism();
int SetSecurityMechanism(const char* lpszSecurityMechanism); Unicode (Windows) LPWSTR GetSecurityMechanism();
INT SetSecurityMechanism(LPCWSTR lpszSecurityMechanism);
char* nfssdk_nfsclient_getsecuritymechanism(void* lpObj);
int nfssdk_nfsclient_setsecuritymechanism(void* lpObj, const char* lpszSecurityMechanism);
QString GetSecurityMechanism();
int SetSecurityMechanism(QString qsSecurityMechanism);
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:
Mechanism | Description |
none | No authentication is required to establish a connection to the server (AUTH_NONE or AUTH_NULL). |
sys | System authentication is required to establish a connection to the server (AUTH_SYS or AUTH_UNIX). |
krb5 | Kerberos v5 with client authentication only. |
krb5i | Kerberos v5 with client authentication and integrity protection. |
krb5p | Kerberos 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 class 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();
Data Type
String
SPN Property (NFSClient Class)
Specifies the Service Principal Name (SPN).
Syntax
ANSI (Cross Platform) char* GetSPN();
int SetSPN(const char* lpszSPN); Unicode (Windows) LPWSTR GetSPN();
INT SetSPN(LPCWSTR lpszSPN);
char* nfssdk_nfsclient_getspn(void* lpObj);
int nfssdk_nfsclient_setspn(void* lpObj, const char* lpszSPN);
QString GetSPN();
int SetSPN(QString qsSPN);
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.
Data Type
String
StartByte Property (NFSClient Class)
The offset in bytes at which to begin the Upload or Download.
Syntax
ANSI (Cross Platform) int64 GetStartByte();
int SetStartByte(int64 lStartByte); Unicode (Windows) LONG64 GetStartByte();
INT SetStartByte(LONG64 lStartByte);
int64 nfssdk_nfsclient_getstartbyte(void* lpObj);
int nfssdk_nfsclient_setstartbyte(void* lpObj, int64 lStartByte);
qint64 GetStartByte();
int SetStartByte(qint64 lStartByte);
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;
}
}
}
Data Type
Long64
Timeout Property (NFSClient Class)
This property includes the timeout for the class.
Syntax
ANSI (Cross Platform) int GetTimeout();
int SetTimeout(int iTimeout); Unicode (Windows) INT GetTimeout();
INT SetTimeout(INT iTimeout);
int nfssdk_nfsclient_gettimeout(void* lpObj);
int nfssdk_nfsclient_settimeout(void* lpObj, int iTimeout);
int GetTimeout();
int SetTimeout(int iTimeout);
Default Value
60
Remarks
If the Timeout property is set to 0, all operations return immediately, potentially failing with a WOULDBLOCK error if data cannot be sent immediately.
If Timeout is set to a positive value, data is sent in a blocking manner and the class will wait for the operation to complete before returning control. The class will handle any potential WOULDBLOCK errors internally and automatically retry the operation for a maximum of Timeout seconds.
The class 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 class fails with an error.
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.
Data Type
Integer
User Property (NFSClient Class)
Specifies the name and domain of the user to authenticate.
Syntax
ANSI (Cross Platform) char* GetUser();
int SetUser(const char* lpszUser); Unicode (Windows) LPWSTR GetUser();
INT SetUser(LPCWSTR lpszUser);
char* nfssdk_nfsclient_getuser(void* lpObj);
int nfssdk_nfsclient_setuser(void* lpObj, const char* lpszUser);
QString GetUser();
int SetUser(QString qsUser);
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.
Data Type
String
Abort Method (NFSClient Class)
Aborts the current upload or download.
Syntax
ANSI (Cross Platform) int Abort(); Unicode (Windows) INT Abort();
int nfssdk_nfsclient_abort(void* lpObj);
int Abort();
Remarks
This method is used to abort the current upload or download.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
Append Method (NFSClient Class)
Appends data from LocalFile to a remote file RemoteFile on a NFS server.
Syntax
ANSI (Cross Platform) int Append(); Unicode (Windows) INT Append();
int nfssdk_nfsclient_append(void* lpObj);
int Append();
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).
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
ChangeRemotePath Method (NFSClient Class)
Changes the current path on the server.
Syntax
ANSI (Cross Platform) int ChangeRemotePath(const char* lpszRemotePath); Unicode (Windows) INT ChangeRemotePath(LPCWSTR lpszRemotePath);
int nfssdk_nfsclient_changeremotepath(void* lpObj, const char* lpszRemotePath);
int ChangeRemotePath(const QString& qsRemotePath);
Remarks
This method changes the current path on the server to the specified RemotePath parameter. When called, the class 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");
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
CheckFileExists Method (NFSClient Class)
Checks whether the file specified by RemoteFile exists on the server.
Syntax
ANSI (Cross Platform) bool CheckFileExists(); Unicode (Windows) bool CheckFileExists();
bool nfssdk_nfsclient_checkfileexists(void* lpObj);
bool CheckFileExists();
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();
}
Error Handling (C++)
This method returns a Boolean value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.
Config Method (NFSClient Class)
Sets or retrieves a configuration setting.
Syntax
ANSI (Cross Platform) char* Config(const char* lpszConfigurationString); Unicode (Windows) LPWSTR Config(LPCWSTR lpszConfigurationString);
char* nfssdk_nfsclient_config(void* lpObj, const char* lpszConfigurationString);
QString Config(const QString& qsConfigurationString);
Remarks
Config is a generic method available in every class. It is used to set and retrieve configuration settings for the class.
These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the class, 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.
Error Handling (C++)
This method returns a String value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.
Connect Method (NFSClient Class)
This method connects to the NFS server.
Syntax
ANSI (Cross Platform) int Connect(); Unicode (Windows) INT Connect();
int nfssdk_nfsclient_connect(void* lpObj);
int Connect();
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();
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
CreateFile Method (NFSClient Class)
Creates a file on the NFS server.
Syntax
ANSI (Cross Platform) int CreateFile(const char* lpszFileName); Unicode (Windows) INT CreateFile(LPCWSTR lpszFileName);
int nfssdk_nfsclient_createfile(void* lpObj, const char* lpszFileName);
int CreateFile(const QString& qsFileName);
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.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
CreateLink Method (NFSClient Class)
Creates a hard link or symbolic link on the server.
Syntax
ANSI (Cross Platform) int CreateLink(const char* lpszLinkName, const char* lpszLinkTarget, int iLinkType); Unicode (Windows) INT CreateLink(LPCWSTR lpszLinkName, LPCWSTR lpszLinkTarget, INT iLinkType);
int nfssdk_nfsclient_createlink(void* lpObj, const char* lpszLinkName, const char* lpszLinkTarget, int iLinkType);
int CreateLink(const QString& qsLinkName, const QString& qsLinkTarget, int iLinkType);
Remarks
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 class should attempt to create. Possible values are 0 or 1.
If specified as 0, the class 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 class 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);
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
DeleteFile Method (NFSClient Class)
This method removes a file specified by FileName from the server.
Syntax
ANSI (Cross Platform) int DeleteFile(const char* lpszFileName); Unicode (Windows) INT DeleteFile(LPCWSTR lpszFileName);
int nfssdk_nfsclient_deletefile(void* lpObj, const char* lpszFileName);
int DeleteFile(const QString& qsFileName);
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");
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
Disconnect Method (NFSClient Class)
This method disconnects from the NFS server.
Syntax
ANSI (Cross Platform) int Disconnect(); Unicode (Windows) INT Disconnect();
int nfssdk_nfsclient_disconnect(void* lpObj);
int Disconnect();
Remarks
This method is used to disconnect from the NFS server.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
DoEvents Method (NFSClient Class)
This method processes events from the internal message queue.
Syntax
ANSI (Cross Platform) int DoEvents(); Unicode (Windows) INT DoEvents();
int nfssdk_nfsclient_doevents(void* lpObj);
int DoEvents();
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 class 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 class 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.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
Download Method (NFSClient Class)
This method downloads a remote file from the NFS server.
Syntax
ANSI (Cross Platform) int Download(); Unicode (Windows) INT Download();
int nfssdk_nfsclient_download(void* lpObj);
int Download();
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();
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
DownloadRange Method (NFSClient Class)
This method downloads a specific segment of a remote file from a NFS server.
Syntax
ANSI (Cross Platform) int DownloadRange(const char* lpszPath, const char* lpszFileName, int64 lStartByte, int iCount, char** lpBuffer, int lenBuffer); Unicode (Windows) INT DownloadRange(LPCWSTR lpszPath, LPCWSTR lpszFileName, LONG64 lStartByte, INT iCount, LPSTR* lpBuffer, INT lenBuffer);
int nfssdk_nfsclient_downloadrange(void* lpObj, const char* lpszPath, const char* lpszFileName, int64 lStartByte, int iCount, char** lpBuffer, int lenBuffer);
int DownloadRange(const QString& qsPath, const QString& qsFileName, qint64 lStartByte, int iCount, QByteArray qbaBuffer);
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);
Error Handling (C++)
This method returns an Integer value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.
ListDirectory Method (NFSClient Class)
This method lists the current working directory on the NFS server.
Syntax
ANSI (Cross Platform) int ListDirectory(); Unicode (Windows) INT ListDirectory();
int nfssdk_nfsclient_listdirectory(void* lpObj);
int ListDirectory();
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:
Character | Escape Sequence |
? | [?] |
* | [*] |
[ | [[] |
\ | [\] |
For example, to match the value [Something].txt, specify the pattern [[]Something].txt.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
MakeDirectory Method (NFSClient Class)
This method is used to create a directory on the NFS server.
Syntax
ANSI (Cross Platform) int MakeDirectory(const char* lpszNewDir); Unicode (Windows) INT MakeDirectory(LPCWSTR lpszNewDir);
int nfssdk_nfsclient_makedirectory(void* lpObj, const char* lpszNewDir);
int MakeDirectory(const QString& qsNewDir);
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.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
QueryFileAttributes Method (NFSClient Class)
This method queries the server for the file attributes of the specified RemoteFile .
Syntax
ANSI (Cross Platform) int QueryFileAttributes(); Unicode (Windows) INT QueryFileAttributes();
int nfssdk_nfsclient_queryfileattributes(void* lpObj);
int QueryFileAttributes();
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();
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
ReadLink Method (NFSClient Class)
Reads a symbolic link on the server.
Syntax
ANSI (Cross Platform) char* ReadLink(const char* lpszLinkName, int *lpSize = NULL); Unicode (Windows) LPSTR ReadLink(LPCWSTR lpszLinkName, LPINT lpSize = NULL);
char* nfssdk_nfsclient_readlink(void* lpObj, const char* lpszLinkName, int *lpSize);
QByteArray ReadLink(const QString& qsLinkName);
Remarks
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();
Error Handling (C++)
This method returns a Binary String value (with length lpSize); after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.
RemoveDirectory Method (NFSClient Class)
This removes a directory specified by DirName from the NFS server.
Syntax
ANSI (Cross Platform) int RemoveDirectory(const char* lpszDirName); Unicode (Windows) INT RemoveDirectory(LPCWSTR lpszDirName);
int nfssdk_nfsclient_removedirectory(void* lpObj, const char* lpszDirName);
int RemoveDirectory(const QString& qsDirName);
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.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
RenameFile Method (NFSClient Class)
This changes the name of RemoteFile to NewName .
Syntax
ANSI (Cross Platform) int RenameFile(const char* lpszNewName); Unicode (Windows) INT RenameFile(LPCWSTR lpszNewName);
int nfssdk_nfsclient_renamefile(void* lpObj, const char* lpszNewName);
int RenameFile(const QString& qsNewName);
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.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
Reset Method (NFSClient Class)
This method will reset the class.
Syntax
ANSI (Cross Platform) int Reset(); Unicode (Windows) INT Reset();
int nfssdk_nfsclient_reset(void* lpObj);
int Reset();
Remarks
This method will reset the class's properties to their default values.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
SetDownloadStream Method (NFSClient Class)
This method sets the stream to which the downloaded data from the server will be written.
Syntax
ANSI (Cross Platform) int SetDownloadStream(NFSSDKStream* sDownloadStream); Unicode (Windows) INT SetDownloadStream(NFSSDKStream* sDownloadStream);
int nfssdk_nfsclient_setdownloadstream(void* lpObj, NFSSDKStream* sDownloadStream);
int SetDownloadStream(NFSSDKStream* sDownloadStream);
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 class 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.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
SetUploadStream Method (NFSClient Class)
This method sets the stream from which the class will read data to upload to the server.
Syntax
ANSI (Cross Platform) int SetUploadStream(NFSSDKStream* sUploadStream); Unicode (Windows) INT SetUploadStream(NFSSDKStream* sUploadStream);
int nfssdk_nfsclient_setuploadstream(void* lpObj, NFSSDKStream* sUploadStream);
int SetUploadStream(NFSSDKStream* sUploadStream);
Remarks
This method is used to set the stream from which the class 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 class and uploaded to the server. The stream should be open and normally set to position 0.
The class 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.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
UpdateFileAttributes Method (NFSClient Class)
This method updates the FileAttributes for the current RemoteFile .
Syntax
ANSI (Cross Platform) int UpdateFileAttributes(); Unicode (Windows) INT UpdateFileAttributes();
int nfssdk_nfsclient_updatefileattributes(void* lpObj);
int UpdateFileAttributes();
Remarks
This method is used to update the FileAttributes for the current RemoteFile. After calling this method, the class 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();
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
Upload Method (NFSClient Class)
This method uploads a file to the NFS server.
Syntax
ANSI (Cross Platform) int Upload(); Unicode (Windows) INT Upload();
int nfssdk_nfsclient_upload(void* lpObj);
int Upload();
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();
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
UploadRange Method (NFSClient Class)
This method uploads a specific segment of data into a remote file on the NFS server.
Syntax
ANSI (Cross Platform) int UploadRange(const char* lpszPath, const char* lpszFileName, int64 lStartByte, int iCount, const char* lpBuffer, int lenBuffer); Unicode (Windows) INT UploadRange(LPCWSTR lpszPath, LPCWSTR lpszFileName, LONG64 lStartByte, INT iCount, LPCSTR lpBuffer, INT lenBuffer);
int nfssdk_nfsclient_uploadrange(void* lpObj, const char* lpszPath, const char* lpszFileName, int64 lStartByte, int iCount, const char* lpBuffer, int lenBuffer);
int UploadRange(const QString& qsPath, const QString& qsFileName, qint64 lStartByte, int iCount, QByteArray qbaBuffer);
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);
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
Connected Event (NFSClient Class)
Fired immediately after a connection completes (or fails).
Syntax
ANSI (Cross Platform) virtual int FireConnected(NFSClientConnectedEventParams *e);
typedef struct {
int StatusCode;
const char *Description; int reserved; } NFSClientConnectedEventParams;
Unicode (Windows) virtual INT FireConnected(NFSClientConnectedEventParams *e);
typedef struct {
INT StatusCode;
LPCWSTR Description; INT reserved; } NFSClientConnectedEventParams;
#define EID_NFSCLIENT_CONNECTED 1 virtual INT NFSSDK_CALL FireConnected(INT &iStatusCode, LPSTR &lpszDescription);
class NFSClientConnectedEventParams { public: int StatusCode(); const QString &Description(); int EventRetVal(); void SetEventRetVal(int iRetVal); };
// To handle, connect one or more slots to this signal. void Connected(NFSClientConnectedEventParams *e);
// Or, subclass NFSClient and override this emitter function. virtual int FireConnected(NFSClientConnectedEventParams *e) {...}
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 Class)
This event fires when a directory entry is received.
Syntax
ANSI (Cross Platform) virtual int FireDirList(NFSClientDirListEventParams *e);
typedef struct {
const char *DirEntry;
const char *FileName;
int IsDir;
int64 FileSize;
const char *FileTime;
int IsSymlink; int reserved; } NFSClientDirListEventParams;
Unicode (Windows) virtual INT FireDirList(NFSClientDirListEventParams *e);
typedef struct {
LPCWSTR DirEntry;
LPCWSTR FileName;
BOOL IsDir;
LONG64 FileSize;
LPCWSTR FileTime;
BOOL IsSymlink; INT reserved; } NFSClientDirListEventParams;
#define EID_NFSCLIENT_DIRLIST 2 virtual INT NFSSDK_CALL FireDirList(LPSTR &lpszDirEntry, LPSTR &lpszFileName, BOOL &bIsDir, LONG64 &lFileSize, LPSTR &lpszFileTime, BOOL &bIsSymlink);
class NFSClientDirListEventParams { public: const QString &DirEntry(); const QString &FileName(); bool IsDir(); qint64 FileSize(); const QString &FileTime(); bool IsSymlink(); int EventRetVal(); void SetEventRetVal(int iRetVal); };
// To handle, connect one or more slots to this signal. void DirList(NFSClientDirListEventParams *e);
// Or, subclass NFSClient and override this emitter function. virtual int FireDirList(NFSClientDirListEventParams *e) {...}
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 class 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 Class)
This event is fired when a connection is closed.
Syntax
ANSI (Cross Platform) virtual int FireDisconnected(NFSClientDisconnectedEventParams *e);
typedef struct {
int StatusCode;
const char *Description; int reserved; } NFSClientDisconnectedEventParams;
Unicode (Windows) virtual INT FireDisconnected(NFSClientDisconnectedEventParams *e);
typedef struct {
INT StatusCode;
LPCWSTR Description; INT reserved; } NFSClientDisconnectedEventParams;
#define EID_NFSCLIENT_DISCONNECTED 3 virtual INT NFSSDK_CALL FireDisconnected(INT &iStatusCode, LPSTR &lpszDescription);
class NFSClientDisconnectedEventParams { public: int StatusCode(); const QString &Description(); int EventRetVal(); void SetEventRetVal(int iRetVal); };
// To handle, connect one or more slots to this signal. void Disconnected(NFSClientDisconnectedEventParams *e);
// Or, subclass NFSClient and override this emitter function. virtual int FireDisconnected(NFSClientDisconnectedEventParams *e) {...}
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 Class)
This event is fired when a file finishes uploading or downloading.
Syntax
ANSI (Cross Platform) virtual int FireEndTransfer(NFSClientEndTransferEventParams *e);
typedef struct {
int Direction; int reserved; } NFSClientEndTransferEventParams;
Unicode (Windows) virtual INT FireEndTransfer(NFSClientEndTransferEventParams *e);
typedef struct {
INT Direction; INT reserved; } NFSClientEndTransferEventParams;
#define EID_NFSCLIENT_ENDTRANSFER 4 virtual INT NFSSDK_CALL FireEndTransfer(INT &iDirection);
class NFSClientEndTransferEventParams { public: int Direction(); int EventRetVal(); void SetEventRetVal(int iRetVal); };
// To handle, connect one or more slots to this signal. void EndTransfer(NFSClientEndTransferEventParams *e);
// Or, subclass NFSClient and override this emitter function. virtual int FireEndTransfer(NFSClientEndTransferEventParams *e) {...}
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 Class)
Fired when information is available about errors during data delivery.
Syntax
ANSI (Cross Platform) virtual int FireError(NFSClientErrorEventParams *e);
typedef struct {
int ErrorCode;
const char *Description; int reserved; } NFSClientErrorEventParams;
Unicode (Windows) virtual INT FireError(NFSClientErrorEventParams *e);
typedef struct {
INT ErrorCode;
LPCWSTR Description; INT reserved; } NFSClientErrorEventParams;
#define EID_NFSCLIENT_ERROR 5 virtual INT NFSSDK_CALL FireError(INT &iErrorCode, LPSTR &lpszDescription);
class NFSClientErrorEventParams { public: int ErrorCode(); const QString &Description(); int EventRetVal(); void SetEventRetVal(int iRetVal); };
// To handle, connect one or more slots to this signal. void Error(NFSClientErrorEventParams *e);
// Or, subclass NFSClient and override this emitter function. virtual int FireError(NFSClientErrorEventParams *e) {...}
Remarks
The Error event is fired in case of exceptional conditions during message processing. Normally the class fails with an error.
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 Class)
This event is fired once for each log message.
Syntax
ANSI (Cross Platform) virtual int FireLog(NFSClientLogEventParams *e);
typedef struct {
int LogLevel;
const char *Message;
const char *LogType; int reserved; } NFSClientLogEventParams;
Unicode (Windows) virtual INT FireLog(NFSClientLogEventParams *e);
typedef struct {
INT LogLevel;
LPCWSTR Message;
LPCWSTR LogType; INT reserved; } NFSClientLogEventParams;
#define EID_NFSCLIENT_LOG 6 virtual INT NFSSDK_CALL FireLog(INT &iLogLevel, LPSTR &lpszMessage, LPSTR &lpszLogType);
class NFSClientLogEventParams { public: int LogLevel(); const QString &Message(); const QString &LogType(); int EventRetVal(); void SetEventRetVal(int iRetVal); };
// To handle, connect one or more slots to this signal. void Log(NFSClientLogEventParams *e);
// Or, subclass NFSClient and override this emitter function. virtual int FireLog(NFSClientLogEventParams *e) {...}
Remarks
This event fires once for each log message generated by the class. 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 Class)
This event is fired when a file starts uploading or downloading.
Syntax
ANSI (Cross Platform) virtual int FireStartTransfer(NFSClientStartTransferEventParams *e);
typedef struct {
int Direction; int reserved; } NFSClientStartTransferEventParams;
Unicode (Windows) virtual INT FireStartTransfer(NFSClientStartTransferEventParams *e);
typedef struct {
INT Direction; INT reserved; } NFSClientStartTransferEventParams;
#define EID_NFSCLIENT_STARTTRANSFER 7 virtual INT NFSSDK_CALL FireStartTransfer(INT &iDirection);
class NFSClientStartTransferEventParams { public: int Direction(); int EventRetVal(); void SetEventRetVal(int iRetVal); };
// To handle, connect one or more slots to this signal. void StartTransfer(NFSClientStartTransferEventParams *e);
// Or, subclass NFSClient and override this emitter function. virtual int FireStartTransfer(NFSClientStartTransferEventParams *e) {...}
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 Class)
This event is fired during the file download or upload.
Syntax
ANSI (Cross Platform) virtual int FireTransfer(NFSClientTransferEventParams *e);
typedef struct {
int Direction;
int64 BytesTransferred;
int PercentDone;
const char *Text; int lenText; int reserved; } NFSClientTransferEventParams;
Unicode (Windows) virtual INT FireTransfer(NFSClientTransferEventParams *e);
typedef struct {
INT Direction;
LONG64 BytesTransferred;
INT PercentDone;
LPCSTR Text; INT lenText; INT reserved; } NFSClientTransferEventParams;
#define EID_NFSCLIENT_TRANSFER 8 virtual INT NFSSDK_CALL FireTransfer(INT &iDirection, LONG64 &lBytesTransferred, INT &iPercentDone, LPSTR &lpText, INT &lenText);
class NFSClientTransferEventParams { public: int Direction(); qint64 BytesTransferred(); int PercentDone(); const QByteArray &Text(); int EventRetVal(); void SetEventRetVal(int iRetVal); };
// To handle, connect one or more slots to this signal. void Transfer(NFSClientTransferEventParams *e);
// Or, subclass NFSClient and override this emitter function. virtual int FireTransfer(NFSClientTransferEventParams *e) {...}
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.
Syntax
NFSSDKFirewall (declared in nfssdk.h)
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.
Fields
AutoDetect
int
Default Value: FALSE
Whether to automatically detect and use firewall system settings, if available.
FirewallType
int
Default Value: 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
char*
Default Value: ""
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 class fails with an error.
Password
char*
Default Value: ""
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 class fails with an error.
Port
int
Default Value: 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
char*
Default Value: ""
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 class fails with an error.
Constructors
Firewall()
NFSFileAttributes Type
Includes a set of attributes for a file existing on an Network File System (NFS) server.
Syntax
NFSSDKNFSFileAttributes (declared in nfssdk.h)
Remarks
This type describes a file residing on an SFTP server.
- AccessTime
- AccessTimeNanos
- AllocationSize
- CreationTime
- CreationTimeNanos
- FileType
- IsDir
- IsSymlink
- LinkCount
- MIMEType
- Mode
- ModifiedTime
- ModifiedTimeNanos
- OwnerGroupId
- OwnerId
- Size
Fields
AccessTime
int64
Default Value: 0
Contains the number of seconds since 12:00:00 AM, January 1, 1970, when this file was last accessed.
AccessTimeNanos
int
Default Value: 0
Contains a subsecond value associated with this file's AccessTime.
AllocationSize
int64 (read-only)
Default Value: 0
Number of file system bytes allocated to this file object.
CreationTime
int64 (read-only)
Default Value: 0
Specifies the number of seconds since 12:00:00 AM, January 1, 1970, when this file was created.
CreationTimeNanos
int (read-only)
Default Value: 0
Contains a subsecond value associated with this file's CreationTime.
FileType
int (read-only)
Default Value: 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
int (read-only)
Default Value: FALSE
Specifies whether or not the file represented by these attributes is a directory.
IsSymlink
int (read-only)
Default Value: FALSE
Specifies whether or not the file or directory represented by these attributes is a symbolic link.
LinkCount
int (read-only)
Default Value: 0
Number of hard links to this object.
MIMEType
char* (read-only)
Default Value: ""
Specifies a value that can be used in the Content-Type header for a MIME entity part containing this file.
Mode
int
Default Value: 0
Mode of a file
ModifiedTime
int64
Default Value: 0
Specifies the number of seconds since 12:00:00 AM, January 1, 1970, that this file was last modified.
ModifiedTimeNanos
int
Default Value: 0
Includes a subsecond value associated with this file's ModifiedTime.
OwnerGroupId
char*
Default Value: ""
The string name of the group ownership of this object.
OwnerId
char*
Default Value: ""
The string name of the owner of this object.
Size
int64
Default Value: 0
Specifies the total size, in bytes, of this file.
NFSSDKStream Type
Syntax
NFSSDKStream (declared in nfssdk.h)
Remarks
The NFSClient class includes one or more API members that take a stream object as a parameter. To use such API members, create a concrete class that implements the NFSSDKStream interface and pass the NFSClient class an instance of that concrete class.
When implementing the NFSSDKStream interface's properties and methods, they must behave as described below. If the concrete class's implementation does not behave as expected, undefined behavior may occur.
Properties | |
CanRead |
Whether the stream supports reading.
bool CanRead() { return true; } |
CanSeek |
Whether the stream supports seeking.
bool CanSeek() { return true; } |
CanWrite |
Whether the stream supports writing.
bool CanWrite() { return true; } |
Length |
Gets the length of the stream, in bytes.
int64 GetLength() = 0; |
Methods | |
Close |
Closes the stream, releasing all resources currently allocated for it.
void Close() {} This method is called automatically when a NFSSDKStream object is deleted. |
Flush |
Forces all data held by the stream's buffers to be written out to storage.
int Flush() { return 0; } Must return 0 if flushing is successful; or -1 if an error occurs or the stream is closed. If the stream does not support writing, this method must do nothing and return 0. |
Read |
Reads a sequence of bytes from the stream and advances the current position within the stream by the number of bytes read.
int Read(void* buffer, int count) = 0; Buffer specifies the buffer to populate with data from the stream. Count specifies the number of bytes that should be read from the stream. Must return the total number of bytes read into Buffer; this may be less than Count if that many bytes are not currently available, or 0 if the end of the stream has been reached. Must return -1 if an error occurs, if reading is not supported, or if the stream is closed. |
Seek |
Sets the current position within the stream based on a particular point of origin.
int64 Seek(int64 offset, int seekOrigin) = 0; Offset specifies the offset in the stream to seek to, relative to SeekOrigin. Valid values for SeekOrigin are:
Must return the new position within the stream; or -1 if an error occurs, if seeking is not supported, or if the stream is closed (however, see note below). If -1 is returned, the current position within the stream must remain unchanged. Note: If the stream is not closed, it must always be possible to call this method with an Offset of 0 and a SeekOrigin of 1 to obtain the current position within the stream, even if seeking is not otherwise supported. |
Write |
Writes a sequence of bytes to the stream and advances the current position within the stream by the number of bytes written.
int Write(const void* buffer, int count) = 0; Buffer specifies the buffer with data to write to the stream. Count specifies the number of bytes that should be written to the stream. Must return the total number of bytes written to the stream; this may be less than Count if that many bytes could not be written. Must return -1 if an error occurs, if writing is not supported, or if the stream is closed. |
Config Settings (NFSClient Class)
The class 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 class, access to these internal properties is provided through the Config method.NfsClient Config Settings
To clarify, when connecting to a server, the client must send a client ID to identify itself. The class 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.
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.
Note this config is read-only.
Note this config is read-only.
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 class 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.
This config must be specified as a comma-separated list of such GIDs, for example: 4,24,27,30,46,110,1000
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_IRUSR | 0x100 | Read permission, owner. |
S_IWUSR | 0x080 | Write permission, owner. |
S_IXUSR | 0x040 | Execute permission, owner. |
S_IRGRP | 0x020 | Read permission, group. |
S_IWGRP | 0x010 | Write permission, group. |
S_IXGRP | 0x008 | Execute permission, group. |
S_IROTH | 0x004 | Read permission, others. |
S_IWOTH | 0x002 | Write permission, others. |
S_IXOTH | 0x001 | Execute 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();
Note: This functionality is only available on Windows.
Base Config Settings
The following is a list of valid code page identifiers:
Identifier | Name |
037 | IBM EBCDIC - U.S./Canada |
437 | OEM - United States |
500 | IBM EBCDIC - International |
708 | Arabic - ASMO 708 |
709 | Arabic - ASMO 449+, BCON V4 |
710 | Arabic - Transparent Arabic |
720 | Arabic - Transparent ASMO |
737 | OEM - Greek (formerly 437G) |
775 | OEM - Baltic |
850 | OEM - Multilingual Latin I |
852 | OEM - Latin II |
855 | OEM - Cyrillic (primarily Russian) |
857 | OEM - Turkish |
858 | OEM - Multilingual Latin I + Euro symbol |
860 | OEM - Portuguese |
861 | OEM - Icelandic |
862 | OEM - Hebrew |
863 | OEM - Canadian-French |
864 | OEM - Arabic |
865 | OEM - Nordic |
866 | OEM - Russian |
869 | OEM - Modern Greek |
870 | IBM EBCDIC - Multilingual/ROECE (Latin-2) |
874 | ANSI/OEM - Thai (same as 28605, ISO 8859-15) |
875 | IBM EBCDIC - Modern Greek |
932 | ANSI/OEM - Japanese, Shift-JIS |
936 | ANSI/OEM - Simplified Chinese (PRC, Singapore) |
949 | ANSI/OEM - Korean (Unified Hangul Code) |
950 | ANSI/OEM - Traditional Chinese (Taiwan; Hong Kong SAR, PRC) |
1026 | IBM EBCDIC - Turkish (Latin-5) |
1047 | IBM EBCDIC - Latin 1/Open System |
1140 | IBM EBCDIC - U.S./Canada (037 + Euro symbol) |
1141 | IBM EBCDIC - Germany (20273 + Euro symbol) |
1142 | IBM EBCDIC - Denmark/Norway (20277 + Euro symbol) |
1143 | IBM EBCDIC - Finland/Sweden (20278 + Euro symbol) |
1144 | IBM EBCDIC - Italy (20280 + Euro symbol) |
1145 | IBM EBCDIC - Latin America/Spain (20284 + Euro symbol) |
1146 | IBM EBCDIC - United Kingdom (20285 + Euro symbol) |
1147 | IBM EBCDIC - France (20297 + Euro symbol) |
1148 | IBM EBCDIC - International (500 + Euro symbol) |
1149 | IBM EBCDIC - Icelandic (20871 + Euro symbol) |
1200 | Unicode UCS-2 Little-Endian (BMP of ISO 10646) |
1201 | Unicode UCS-2 Big-Endian |
1250 | ANSI - Central European |
1251 | ANSI - Cyrillic |
1252 | ANSI - Latin I |
1253 | ANSI - Greek |
1254 | ANSI - Turkish |
1255 | ANSI - Hebrew |
1256 | ANSI - Arabic |
1257 | ANSI - Baltic |
1258 | ANSI/OEM - Vietnamese |
1361 | Korean (Johab) |
10000 | MAC - Roman |
10001 | MAC - Japanese |
10002 | MAC - Traditional Chinese (Big5) |
10003 | MAC - Korean |
10004 | MAC - Arabic |
10005 | MAC - Hebrew |
10006 | MAC - Greek I |
10007 | MAC - Cyrillic |
10008 | MAC - Simplified Chinese (GB 2312) |
10010 | MAC - Romania |
10017 | MAC - Ukraine |
10021 | MAC - Thai |
10029 | MAC - Latin II |
10079 | MAC - Icelandic |
10081 | MAC - Turkish |
10082 | MAC - Croatia |
12000 | Unicode UCS-4 Little-Endian |
12001 | Unicode UCS-4 Big-Endian |
20000 | CNS - Taiwan |
20001 | TCA - Taiwan |
20002 | Eten - Taiwan |
20003 | IBM5550 - Taiwan |
20004 | TeleText - Taiwan |
20005 | Wang - Taiwan |
20105 | IA5 IRV International Alphabet No. 5 (7-bit) |
20106 | IA5 German (7-bit) |
20107 | IA5 Swedish (7-bit) |
20108 | IA5 Norwegian (7-bit) |
20127 | US-ASCII (7-bit) |
20261 | T.61 |
20269 | ISO 6937 Non-Spacing Accent |
20273 | IBM EBCDIC - Germany |
20277 | IBM EBCDIC - Denmark/Norway |
20278 | IBM EBCDIC - Finland/Sweden |
20280 | IBM EBCDIC - Italy |
20284 | IBM EBCDIC - Latin America/Spain |
20285 | IBM EBCDIC - United Kingdom |
20290 | IBM EBCDIC - Japanese Katakana Extended |
20297 | IBM EBCDIC - France |
20420 | IBM EBCDIC - Arabic |
20423 | IBM EBCDIC - Greek |
20424 | IBM EBCDIC - Hebrew |
20833 | IBM EBCDIC - Korean Extended |
20838 | IBM EBCDIC - Thai |
20866 | Russian - KOI8-R |
20871 | IBM EBCDIC - Icelandic |
20880 | IBM EBCDIC - Cyrillic (Russian) |
20905 | IBM EBCDIC - Turkish |
20924 | IBM EBCDIC - Latin-1/Open System (1047 + Euro symbol) |
20932 | JIS X 0208-1990 & 0121-1990 |
20936 | Simplified Chinese (GB2312) |
21025 | IBM EBCDIC - Cyrillic (Serbian, Bulgarian) |
21027 | Extended Alpha Lowercase |
21866 | Ukrainian (KOI8-U) |
28591 | ISO 8859-1 Latin I |
28592 | ISO 8859-2 Central Europe |
28593 | ISO 8859-3 Latin 3 |
28594 | ISO 8859-4 Baltic |
28595 | ISO 8859-5 Cyrillic |
28596 | ISO 8859-6 Arabic |
28597 | ISO 8859-7 Greek |
28598 | ISO 8859-8 Hebrew |
28599 | ISO 8859-9 Latin 5 |
28605 | ISO 8859-15 Latin 9 |
29001 | Europa 3 |
38598 | ISO 8859-8 Hebrew |
50220 | ISO 2022 Japanese with no halfwidth Katakana |
50221 | ISO 2022 Japanese with halfwidth Katakana |
50222 | ISO 2022 Japanese JIS X 0201-1989 |
50225 | ISO 2022 Korean |
50227 | ISO 2022 Simplified Chinese |
50229 | ISO 2022 Traditional Chinese |
50930 | Japanese (Katakana) Extended |
50931 | US/Canada and Japanese |
50933 | Korean Extended and Korean |
50935 | Simplified Chinese Extended and Simplified Chinese |
50936 | Simplified Chinese |
50937 | US/Canada and Traditional Chinese |
50939 | Japanese (Latin) Extended and Japanese |
51932 | EUC - Japanese |
51936 | EUC - Simplified Chinese |
51949 | EUC - Korean |
51950 | EUC - Traditional Chinese |
52936 | HZ-GB2312 Simplified Chinese |
54936 | Windows XP: GB18030 Simplified Chinese (4 Byte) |
57002 | ISCII Devanagari |
57003 | ISCII Bengali |
57004 | ISCII Tamil |
57005 | ISCII Telugu |
57006 | ISCII Assamese |
57007 | ISCII Oriya |
57008 | ISCII Kannada |
57009 | ISCII Malayalam |
57010 | ISCII Gujarati |
57011 | ISCII Punjabi |
65000 | Unicode UTF-7 |
65001 | Unicode UTF-8 |
Identifier | Name |
1 | ASCII |
2 | NEXTSTEP |
3 | JapaneseEUC |
4 | UTF8 |
5 | ISOLatin1 |
6 | Symbol |
7 | NonLossyASCII |
8 | ShiftJIS |
9 | ISOLatin2 |
10 | Unicode |
11 | WindowsCP1251 |
12 | WindowsCP1252 |
13 | WindowsCP1253 |
14 | WindowsCP1254 |
15 | WindowsCP1250 |
21 | ISO2022JP |
30 | MacOSRoman |
10 | UTF16String |
0x90000100 | UTF16BigEndian |
0x94000100 | UTF16LittleEndian |
0x8c000100 | UTF32String |
0x98000100 | UTF32BigEndian |
0x9c000100 | UTF32LittleEndian |
65536 | Proprietary |
- 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.
This setting only works on these classes: AS3Receiver, AS3Sender, Atom, Client(3DS), FTP, FTPServer, IMAP, OFTPClient, SSHClient, SCP, Server(3DS), Sexec, SFTP, SFTPServer, SSHServer, TCPClient, TCPServer.
Setting this configuration setting to true tells the class 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.
To use the system security libraries for Linux, OpenSSL support must be enabled. For more information on how to enable OpenSSL, please refer to the OpenSSL Notes section.
Trappable Errors (NFSClient Class)
Error Handling (C++)
Call the GetLastErrorCode() method to obtain the last called method's result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. Known error codes are listed below. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.
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. |