:OpenFile()
Class
Syntax
:OpenFile( cFilename, [nMode], [hSession]) ->
Parameters
|
|
cFilename |
String that specifies the name of the remote file to create or open. The file pathing and name conventions must be that of the remote host. |
|
|
nMode |
Numeric. Open mode for file cFilename. See table below. Default is FTP_FILE_READ |
|
|
hSession |
Optional: If hSession is not passed, the value in :Session will be used |
nMode specifies the type of access to the file.
An application can open a file for reading, create a new file or append data to an existing file.
This parameter should be one of the following values.
|
Value |
Description |
|
FTP_FILE_READ |
The file is opened for reading on the remote server. A data channel is created and the contents of the file are returned to the client. |
|
FTP_FILE_WRITE |
The file is opened for writing on the remote server. If the file does not exist, it will be created. If it does exist, it will be overwritten. |
|
FTP_FILE_APPEND |
The file is opened for writing on the remote server. All data will be appended to the end of the file. |
Return
Logical indicating Success.
Returns .T. if the operation succeeds, otherwise returns .F.
To get further error information see :nErr and :cErr
To see the remote server's response, see :GetResultCode() and :GetResultString().
Description
The :OpenFile() method creates or opens the specified file on the remote server.
Only one file may be opened at a time for each client session.
Use the :CloseFile() method to close the file on the remote server.
When a file is created on the remote server, the file ownership and access rights are determined by the server. Some servers may provide a method to change these attributes through site-specific commands. Refer to the server's operating system documentation for more information about what commands may be available.
See Also
:CloseFile(), :GetFileLength()