? tab(-10, AG_FTP); dirflag; hostpath; chr(126); localpath; chr(127);
AG_FTP (22) may be used on server installation of A-Shell to cause the ATE client to initiate a file transfer with the server.
Parameters
dirflag
A single character indicating the file transfer type and direction, from the following choices:
Value |
Direction |
Type |
Feedback |
0 |
Host to PC |
Binary |
message/dialog |
1 |
PC to host |
Binary |
message/dialog |
2 |
Host to PC |
ASCII |
message/dialog |
3 |
PC to host |
ASCII |
message/dialog |
A |
Host to PC |
Binary |
silent |
B |
PC to host |
Binary |
silent |
C |
Host to PC |
ASCII |
silent |
D |
PC to host |
ASCII |
silent |
Codes A though D are not ZTERM-compatible, so should only be used when you know the client is ATE. Note that with ATE, the msg/dialog is hardly noticeable (unlike with ZTERM, where it looks just like the standard interactive FTP dialog), so the silent feature isn't that much of an improvement. Still, some people prefer to have their file transfers be invisible to the user.
hostpath
Native specification for the file on the server. If sending to the server, this may specify just the directory, in which case the filename will be taken from the localpath.
localpath
Native (PC) specification of the source file. When transferring to the PC, this may be just a directory, in which case the filename is taken from hostpath.
Return value
A single byte will be placed in the keyboard buffer to indicate success (ASCII 13, aka RETURN) or failure (ASCII 3, aka Control-C).
Examples
! transfer dsk0:test.dat[100,1] on server to dsk0:test.sav[100,999] on PC
? TAB(-10,AG_FTP);"0/vm/miame/dsk0/100001/test.dat";chr(126); &
"%MIAME%\dsk0\100999\test.sav";chr(127);
xcall ACCEPN,A
! transfer dsk0:*.*[1,2] on server to TEMP directory on PC
? TAB(-10,AG_FTP);"0/vm/miame/dsk0/001002/*";chr(126);"%TEMP%;chr(127);
xcall ACCEPN,A
? transfer all files from PC "ATELOCALDIR" directory to /vm/miame/dsk0/033033
? TAB(-10,AG_FTP);"1/vm/miame/dsk0/033033";chr(126); &
"%ATELOCALDIR%\*";chr(127);
xcall ACCEPN,A
Notes
The file wildcard "*" may be used to transfer all the files in a particular directory; see the second and third examples above.
This command only works when the client is ATE. If you have a mixture of ZTERM and ATE clients, you would be better off using the ZTERM Escape Sequences, which work for both ZTERM and ATE. In either case, you are limited to transferring files between the server where the application is running, and the client workstation, using the FTP login credentials stored in the ZTERM or ATE configuration.
If you are running locally under A-Shell/Windows and want to transfer files to an arbitrary FTP server, then use FTPDLX.SBX, which allows you to specify the server IP address and login parameters. For debugging ideas, see FTP Debugging.
Note that the FTP facility described here refers to a Windows-based FTP client. In order to transfer files between the workstation and another computer, the remote end must have an FTP server that accepts connections from your workstation. If you an FTP server is not available on the computer you want to transfer files to or from, then you will have to use some other kind of file transfer method. One possibility is to implement your own protocol using TCPX.SBX. There is a working example of such a protocol, complete with interactive server and client interfaces, in the sample program TCPXFR, which is available in the EXLIB.
If you are having trouble getting FTP transfers to work, you should first verify that your client can establish an FTP connection with the server, by using some other FTP client (such as the Microsoft FTP.EXE program). If it can’t connect, the A-Shell’s FTP won’t be able to either, and if it can connect, then A-Shell’s should be able to also.
As another debugging aid, the FTP routine automatically creates a log file, SYS:FTPDLX.LOG, which contains (somewhat human readable) details about the file transfer operation. In addition, if the environment variable ASHFTPDEBUG is defined, a more detailed, lower-level log will written to %TEMP%\ftpdebug.log (or, prior to 1153.1, c:\debug.log.
Note that AG_FTP (22) uses the A-Shell subroutine FTPDLX.
History
2009 December, A-Shell 1131: You can now request that the PC file name be set to match that assigned to the last file printed via the AUXLOC: channel, by specifying a PC filespec ending in "-#." + the extension. For example,
TAB(-10,AG_FTP);"0/tmp/abcdef.dat~%abcdef-#.dat";chr(127);
This will send the file /tmp/abcdef.dat to the PC, where it will given the full spec ??????.dat, where ????? is the complete path of the last printfile captured by ATE (minus the extension). Note that the only part of the PC filespec which matters in this case was "-#.dat"; including the "abcdef-#.dat" only serves as a fallback if the version of ATE doesn't support the feature, or there was no prior printed filespec to refer to.
This trick can be useful for sending metadata files which should be associated with print files, perhaps containing routing or archiving instructions.
2007 April, A-Shell 986: FTP transfers now support more flexible wildcards. Previously, the only wildcard option was "*" to transfer all files in the source directory. Now you can separately wildcard the file name and extension, and you can include partial literals in both parts of the name. Examples:
/vm/miame/dsk0/007006/*.dat
/vm/miame/dsk0/007006/ab*
c:\vm\miame\dsk0\007006\xyz*.d*
Notes:
• The only wildcard character remains "*" (? is not supported)
• PC filespecs are not case sensitive, but HOST filespecs are.
• The actual code change is in the module FTPDLXcall.DLL 1.2.0.117, which is normally found in the same directory as ASHW32.EXE. It gets loaded on demand when transferring a file via AG_FTP or FTPDLX.SBR or the ZTERM file transfer ESCAPE sequence.