Back to product page

RemoteOpen function


Opens remote file for raw access.

Type

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

Syntax

  • C
long Sftp_RemoteOpen(void *Sftp, char *RemoteFile, RemotePermissions Permission);
The RemoteOpen(void *Sftp,char *RemoteFile,Permission) syntax has these parts:
void *SftpHandle of the created Sftp instance.
char *RemoteFileFull path to a file on the server.
PermissionRemotePermissions . Defines combination of flags to open remote file.

Remarks

The settings for Permission are:

Constant Value Description
PermRead1 Opens remote file with read permissions.
PermWrite 2 Opens remote file with write permissions.
PermCreate 4 Creates remote file.
PermTruncate 8 Truncates remote file.


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.

Platforms

Windows