Updated April 2015; see History
xcall FTPDLX, host, user, password, localpath, hostfile, hostdir, opcode, status {, port, emsg, privkey, passphrase}
(Windows only) FTPDLX.SBR sends and receives files via FTP from A-Shell. FTP2, which see for details, provides the same service in a slightly different way while using the same syntax and parameters.
host (String) [in]
Specifies the name or IP address of the HOST computer you want to send files to or receive files from.
user (String) [in]
Specifies the user login name for the remote HOST. For anonymous FTP, use "anonymous"
password (String) [in]
Specifies the login password. For anonymous FTP, use your email address (e.g. myname@mydoman.com)
localpath (String) [in]
Full pathspec (PC format) for the local file (whether sending or receiving.) If no directory specified, the current login directory will be used. Note: you may want to use MIAMEX, MX_FSPEC to translate an AMOS directory specification to a PC version. See Comments below for wildcarding.
hostfile (String) [in]
May be the full pathspec of the remote file, or just the filename and extension. In the former case, leave HOSTDIR blank, otherwise specify the directory in HOSTDIR. HOSTFILE is case sensitive. See Comments below for wildcarding.
hostdir (String) [in]
If not blank, it is prepended to the hostfile field to form the full pathspec of the remote file. hostdir is case sensitive.
opcode (Num) [in]
Note that while most of the codes apply to both FTPDLX and FTP2, some apply—as indicated—only to one or the other.
Symbol |
Value |
Description |
XFTPF_GET |
&h000000 |
Transfer from server to client PC. |
XFTPF_PUT |
&h000001 |
Transfer from client PC to server. |
XFTPF_ASCII |
&h000002 |
ASCII transfer mode. Note that some FTP servers will ignore the ASCII option as a security precaution. |
XFTPF_NOERRMSG |
&h000010 |
Disable the error message dialog box display that will otherwise appear in the case of errors. In either case, the error code is also returned in the STATUS parameter. |
XFTPF_PASSIVE |
&h000020 |
Passive transfer mode. This is often needed to get past firewall restrictions. |
XFTPF_NOBANNER |
&h000040 |
Suppress the transfer banner. |
XFTPF_DEBUG |
&h000080 |
Activates debug mode, which writes out a very detailed log file to C:\DEBUG.LOG. This is mainly of use when trying to solve low-level protocol problems. FTPDLX only. |
XFTPF_SFTP |
&h000100 |
Use SFTP protocol instead of FTP. This requires a SSH2 service on the server side, typically at port 22. |
XFTPF_RMVEXT |
&h000200 |
Rename host file after transfer, removing the last extension. This may be useful to prevent the file from being accessed by the remote system until the transfer is complete. Since it removes the last extension, you probably want to set the host file to have two extensions, such as MYFILE.DAT.UP. After the transfer is complete, the file would be renamed to MYFILE.DAT. FTPDLX only. |
XFTPF_VERSION2 |
&h010000 |
Request FTP2. FTPSYNC mode only. |
XFTPF_KEEPOPEN |
&h020000 |
Keep connection open. FTP2 only. |
XFTPF_REUSE |
&h040000 |
Reuse previous connection if available. FTP2 only. |
XFTPF_CLOSE |
&h080000 |
Close connection, no transfer. FTP2 only.. |
XFTPF_DEL |
&h100000 |
Remote delete. FTP2 only. |
Definition file: ashell.def |
status (F,6) [out]
*Return status. 0=success. Negative numbers are internal errors in FTPDLXcall which you can see from the source code and which are listed in the table below. -1 indicates a user abort. Numbers 1000 and up are EZFTP.OCX errors.
port (Num) [in]
Specifies the control port to connect to the FTP server on. Default is 21 for FTP and 22 for SFTP.
emsg (String) [out]
May return a message on error.
privkey (String) [in])
contains the filespec of private key file in OpenSSH format. If specified and non-blank, FTPDLX will use public/private key authentication rather than standard password authentication.
passphrase (String) [in]
is the passphrase for the private key. May be omitted if the private key is not passphrase-protected.
Comments
• Nothing is displayed during the transfer, unless an error occurs and opcode +16 is not specified .
• You can rename FTPDLX to another name, provided that you change the ALIAS statement in miame.ini accordingly (change only the part to the left of the colon)
• The source file specification (in localpath or hostfile, depending on the directory of the transfer) may contain the "*" wildcard. For example, "/vm/miame/dsk0/007006/*.dat", or "/vm/miame/dsk0/007006/ab*", or even "c:\vm\miame\dsk0\007006\cyxz*.d*"
• FTPDLX is actually an internal front-end to an external COM routine, and is dependent on the following entry in the miame.ini:
ALIAS=FTPDLX:FtpDLXcall.FTP
It relies on two dlls: FTPDLXcall2.dll and wodFtpDLX.dll, both of which are normally stored in the %MIAME%\bin directory, and both of which must be registered (using regsvr32.exe). (The ALIAS, dlls, and registration are handled automatically by a typical installation, but might require a manual assist if the installation was set up manually using COPY commands rather than the installer.)
FTPDLX is based on a commercial COM FTP control called wodFTPDLX by WeOnlyDo Controls, the runtime license for which is included with A-Shell.
FTPDLX relies on two DLLs, wodFTPDLX and FTPDLXcall, being in the bin directory (where ashw32 is loaded from), and it requires the following miame.ini statement:
ALIAS=FTPDLX:FTPDLXcall.FTP
FTPDLX is used internally by ATE to implement the AG_FTP and ZTERM file transfer escape sequence. See also:
• ZTXFER.LIT and ATSYNC.LIT.
• ATEAPX.SBX
2015 April, A-Shell 6.1.1406: Added FTP/SFTP remote delete.
2014 May, A-Shell 6.1.1385: Add parameters privkey and passphrase.
2014 February, A-Shell 6.1.1379: Rewrote opcode table to add new options for FPT2 and to improve clarity.
2008 June, A-Shell 5.1.1116: FtpDLXcall2.DLL 5.1.0.204 supports flag 512 (rename host file after copy) in conjunction with wildcarding. Also, when wildcards are specified, an additional log file, ftpdlx.lst, will be created showing the wildcard and the matching files, and if the renaming option is on, the ftpdlx.log file will also show each individual rename. Also, if the remote server doesn't allow renaming if the target already exists, FTPDLX will send an explicit delete command and then try renaming
Value |
Description |
-1 |
too few params |
-2 |
can't malloc (or out of malloc hdls) |
-3 |
no such Opcode |
-4 |
misc param error |
-5 |
can't dynamically link library |
-6 |
license failure |
-7 |
error during adding file (upload) |
-8 |
error during SyncRequest |
-9 |
error processing file for post |
-10 |
unable to allocate string buf |
-11 |
error during put |
-12 |
error during download |
-13 |
unable to log in to server (FTP OR SSH) |
-14 |
unable to log to directory on server (FTP) |
-15 |
failure to connect (ssh) |
-17 |
open session failure (ssh) |
-18 |
pty (termtype?) failure (ssh) |
-19 |
shell startup failure (ssh) |
-20 |
error receiving data (ssh) |
-21 |
error sending data (ssh) |
-22 |
connection lost (ssh) |
-23 |
no channel (ssh) |
-24 |
received eof (ssh) |
-25 |
cert problem |
-26 |
get failed (no access?) |
-27 |
bad cipher type |
-28 |
invalid key len |
-29 |
bad cipher mode |
-30 |
bad padding value |
-31 |
bad file (or file error) |
-32 |
catch-all CRYPT errors |
-33 |
bad encoding |
-34 |
bad public key (or error extracting it) |
-35 |
bad private key (or error extracting it) |
-36 |
failure to open remote file |
-37 |
attempt to call function already executing |
-38 |
error uploading (possibly local file doesn't exist?) |
-39 |
error close remote |
-99 |
unsupported platform (Windows only) |