Added March 2008
xcall FTPDLX, host, user, password, localpath, hostfile, hostdir, opcode, status {,port {,emsg}}
(Windows only) FTPDLX.SBR allows you to send and receive files via FTP from A-Shell.
Parameters
host (String)
Specifies the name or IP address of the HOST computer you want to send files to or receive files from.
user (String)
Specifies the user login name for the remote HOST. For anonymous FTP, use “anonymous”
password (String)
Specifies the login password. For anonymous FTP, use your email address (e.g. myname@mydoman.com)
localpath (String)
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 function 3 to translate an AMOS directory specification to a PC version. See notes below for wildcarding.
hostfile (String)
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 notes below for wildcarding.
hostdir (String)
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)
Value | Description |
0 | Transfer from Host to local PC (binary transfer) |
1 | Transfer from local PC to Host (binary transfer) |
2 | Transfer from Host to local PC (ASCII transfer) |
3 | Transfer from local PC to Host (ASCII transfer) |
+16 | (Add 16 to above values to 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.) |
+32 | (Add 32 to use passive transfer mode. This is often needed to get past firewall restrictions.) |
+128 | 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. |
+256 | Use SFTP protocol instead of FTP. (This requires a SSH2 service on the server side, typically at port 22.) |
+512 | 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.) |
status (F,6)
*Return status. 0=success. Negative numbers are internal errors in FTPDLXcall which you can see from the source code. (-1 indicates a user abort.) Numbers 1000 and up are EZFTP.OCX errors (see next section).
port (Num)
Specifies the control port to connect to the FTP server on. Default is 21 for FTP and 22 for SFTP.
emsg (String)
May return a message on error.
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.)
History
2008 June, 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