wodSFTP API library - RemoteOpen Method
      
 

Description

Opens remote file for raw access.


Return type
A Long value. If successful, 0 is returned, otherwise error as specified here

Syntax

long Sftp_RemoteOpen(void *Sftp, char *RemoteFile, RemotePermissions Permission);

The RemoteOpen function syntax has these parts:

Part Description
void *Sftp Handle of the created Sftp instance.
char *RemoteFile Full path to a file on the server.
Permission RemotePermissions enum. Defines combination of flags to open remote file.

 
Settings
The settings for Permission are:
Constant Value Description
 PermRead 1 Opens remote file with read permissions.
 PermWrite 2 Opens remote file with write permissions.
 PermCreate 4 Creates remote file.
 PermTruncate 8 Truncates remote file.

Remarks

The RemoteOpen function will open remote file so you can access it as raw data - to manually read or write to parts of that file. You will use RemoteRead and RemoteWrite for accessing the file.

When opening file, you should specify Permissions for opening the file, as specifies in Settings section.

While remote file is opened, you should not call other functions than RemoteRead, RemoteWrite, RemoteClose since they may interfere with raw data access. Only one file can be opened at a time using RemoteOpen function.