|
hBasic Manual FTP related
commands
|
|||||||||||||||||||||||||||||||
|
FTP
Commands FTP.<XXX> Return Flags
An optional return flag was inserted into these FTP
client commands.
FTP.OPEN
{ok_nvar,}
url_sexp,
port_nexp,
user_sexp,
pw_sexp
FTP.PUT {ok_nvar,} source_sexp, destination_sexp FTP.GET {ok_nvar,} source_sexp, destination_sexp FTP.DIR {ok_nvar,} list_nvar {,dirmark_sexp} FTP.CD {ok_nvar,} new_directory_sexp FTP.RENAME {ok_nvar,} old_filename_sexp, new_filename_sexp FTP.DELETE {ok_nvar,} filename_sexp FTP.RMDIR {ok_nvar,} directory_sexp FTP.MKDIR {ok_nvar,} directory_sexp FTP.CLOSE {ok_nvar} If ok_nvar is not present, an error will stop with an error message (like legacy Basic). If ok_nvar is present, the app will not stop with a run-time error. if ok_nvar is 1 (true), the command was successful. There was no error. if ok_nvar is 0, (false) there was an error. Further information may be contained in getERROR$(). Note that if you don't use this flag (omitted), then it's following comma (if any) is ignored. |
|||||||||||||||||||||||||||||||
|
FTPS
Commands
These commands are able to control hBasic's built-in ftp server
programmatically.
FTPS.SET return_code_nvar {, port_nexp}
{, username_sexp}
{, password_sexp}
{, welcome_string_sexp}
Configures the server. Do this before starting the server. Do not use this command if the server is running, otherwise the outcome is unpredictable. return_code_nvar
(see FTPS return
codes)
Commas are need to separate parameters if they are
used.
e.g
FTPS.SET
rc,5555,"john", p$, "Welcome to myApp's
Server"
FTPS.SET rc, ,"john", "mypass" FTPS.SET rc, , ,newpassword$
Do not put any newlines ("\n") inside the welcome
string.
Note that some ftp-clients do not allow to have empty usernames and/or passwords.
FTPS.START
return_code_nvar
{,IP_svar}
Starts the server.
return_code_nvar
(see
FTPS return codes) IP_svar
The IP returned as the server's ip address plus the
port number used as "d.d.d.d:port"
e.g 192.0.0.105:2345
e.g
FTPS.START rc,
IP$
IF rc > 0 THEN PRINT "Error" ELSE PRINT "Server started on ";IP$
FTPS.STOP
return_code_nvar
Stops the server.
return_code_nvar
(see
FTPS return codes)
e.g
FTPS.STOP
rc
IF rc <> 0 THEN PRINT "Error" ELSE PRINT "Server stopped"
If flag is true
then a loopback address (127.0.0.1) is forced for the
server IP.
If the flag is false then the server address is auto-detected (default). This is only ever useful if your app is being tested in a emulator. For most situations this flag should be false (the default if unused). You might need this command if you had previously set the loopback in the Editor Preferences and need to reset it before a run. Do not use this command if the server is running, otherwise the outcome is unpredictable.
e.g
FTPS.LOOPBACK
0
% turn off the
loopback
Some commands return an exit code (not optional) which
will be one of the following;
|
|||||||||||||||||||||||||||||||
| -End |