home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 3
/
PDCD_3.iso
/
internet
/
tcpip204
/
TCPIP_Doc
/
Notes
/
FTPClient
< prev
next >
Wrap
Text File
|
1995-03-03
|
21KB
|
632 lines
New facilities in FTP Client (v2.04)
=====================================
The FTP client in !TCPIP has undergone the first stage of improvements
aimed at sorted out UNIX -> RISC OS path convertion problems, and making
it a bit more automated.
These include the addition of:
A highly configurable path name processor.
A batch ftp facilty (source command).
An "mget" command.
A "reget" command.
"quote" and "site" commands.
{ftp_data} and {ftp_list} variables.
v2.04 also adds:
Preset options, set from main command window, or Config file.
Fully automatic login based on data in an FTP server accounts file.
Automatic execution of command files.
Selectable prompt types, showing current directory.
Selectable information level.
A new ftp command "aftp" that allow instant logins, and optional
command file selection.
Pathname Processor
~~~~~~~~~~~~~~~~~~
The path handling is the main area of improvement, and now allows UNIX
style paths to be parsed for file type extraction from one or more file
name extensions and is able to work out appropriate processing based
upon the extensions present or elements in the basic file name.
On the basis of the file name and/or extensions, the ftp client can now
work out what file type to give the file, which directory to store it in
and whether to keep unconverted extensions, whether to keep directory
elements from the original remote path etc.
When there is more than one extension, it is able to sensible use one
extension to determine the file's type and another extension, or the
file's name, to determine in which directory the file should be placed.
These conversions are done according to a set of rules given in a new
!TCPIP resource file. (!TCPIPUser.PathEnt).
When downloading groups of files, for example, the entired contents of a
directory and subdirectories containing C source files, there are often
files which might end up being placed in a different directory to the
rest as a consequence of name/extension base placing. As this can be
undesirable, it is posible to switch off the fully automatic processing,
and force preset processing according to the type of download your are
doing. This is most useful when using the new batch facility.
Finally, just in case there are any problems that I have missed, the old
original path name handling is still available in a rather more useable
and improved form.
Whatever path processing options are in use, directories are
automatically created. The lack of this was one of the most annoying
problems with previous versions of the FTP client. Also filenames are no
longer actively truncated, allowing advantage to be taken of such
utilities as !LongFiles. With appropriate Risc OS configuration, overly
long filenames will still be truncated, but by Risc OS rather than the
FTP client.
PathEnt file
~~~~~~~~~~~~
The !TCPIPUser.PathEnt consist of a series of either options lines, or
name matching lines. When trying to match a name or extensions, three
types of matching are carried out. These are:
1. Match the file name to determine where to put the file.
2. Match an extension to determine where to put the file.
3. Match an extension to determine a file type.
The first match in each of the above categories is the one used. How
this effects the layout of the PathEnt file will become clear.
Each options line starts with a "$" character and is followed by
required options on the same line, each separated by a space.
There are three types of options line as follows:
$root <pathname>
"$root <FTP$Dir>"
This must be present, once only. The given pathname set the root
directory in which files are to be placed. Normally, this is set to
"<FTP$Dir>" which in turn is set to "!TCPIPUser.Downloads".
$default [<option>...]
Example: "$default nocase nfsext truncdir keepext in Misc type &fff"
This line must be present, once only. It sets the default path
processing options this are modified by options given later, or applied
directly to any paths that are not otherwise matched.
$ [<option>...]
Example: "$ rev1ext in Source"
This line contains options that are to be applied to subsequent
extension/filename decoding lines. Any options given are applied in
addition to those given in the default options line.
Lines starting with a "#" character, or blank lines are ignored.
Lines starting with a "." describe extensions matching. Other lines
describe filename matching.
Extension and file name matching lines are as follows:
<name>/.<ext>[|<name>/.<ext>...] <file type> [<options>]
Examples: ".c|.cpp|.c++|.h|.[1-8]|.s|.y|.l &fff"
"rfc* &fff in RFCs"
"/" in the above is used to represent "or" in the syntax rather than the
usual "|" as "|" is literally used to separate extensions in a list.
There must be no spaces in the extensions part.
The use of wildcards is allowed in the name and extension as follows:
"*" matches any string of 0 or more characters.
"?" matches any single character.
"[...]" matches a range of characters, for eg, [0-9] matches 0, 1, 2,
3 ... 9.
The file type is a valid RISC OS file type, for example, "Text" "fff",
"&fff" etc.
Addition extension specific options may also be given by including the
option after the file type.
Options:
nocase Treat upper and lower case alike in matching
keepext Keep extensions as file/ext1/ext2 etc
noext Remove all extensions
revext Reverse extensions so that dir/file.a.b becomes
dir.b.a.file
rev1ext Reverse 1st extension only, so that app/file.c.gz
becomes app.c.file/gz
nopath Strip path prefix for remote name so.
in <dir> Places file in directory <dir>. Unless <dir> is a full
path name, <dir> is assumed to be a sub-directory of the
specified root directory.
type <type> Set the default type to be applied in the absence of any
other information.
nfsext Enables the handling of Acorn NFS style ,xxx hex extensions.
Any option prefixed with "!" is switched off rather than on.
When a type is matched, the corresponding extension is allways removed.
An Example File
# Set the location of the downloads directory.
$root <FTP$Dir>
# Set default options as follows:
# case-insensitive matching, handling of NFS extensions, keep
# extensions as file/ext/ext unless told not to,
# place unmatched file in "<FTP$Dir>.Misc"
# set their type to Text (&fff)
$default nocase nfsext keepext in Misc type &fff
# These option are applied to the following type matches until
# another options lines is encountered. These options are applied in
# addition to those given on the defaults line above.
#
# Ensure directory elements in original remote path name are stripped.
# Ensure extensions are stripped, leaving just the filename.
# Place matched files in directory "<FTP$Dir>.Docs"
$ nopath noext in Docs
.txt &fff
.doc &fff
.asc &fff
.ps &ff5
# A new set of options to be applied. This completely replaces those
# given in the previous options line, and is applied to the following
# match lines.
#
# Basically as above, but put files in "<FTP$Dir>.Archives"
$ nopath noext in Archives
.arc &ddc
.archive &ddc
.spark &ddc
.spk &ddc
.tar.gz &ddc
.tar.z &ddc
.tar &ddc
.gz &ddc
.z &ddc
.zip &ddc
# A new set of options for Image files
# The files end of in "<FTP$Dir>.Archives"
$ nopath noext in Images
.jpeg|.jpg &c85
.gif &695
.tiff|.tif &ff0
# A more complicate extensions set for dealing with source file downloads.
#
# this matches .c, .c++, .cpp, .h, .1, .2, .3, .4, .5, .6, .7, .8,
# .s, .y, and .l.
#
# The first extension and file name are swapped round so that you
# get c.*, h.* files.
#
# Also, as these options *replace* previous ones, directory elements in
# the original path name are retained. So applic/source.c becomes
# applic.c.source.
$ rev1ext in Source
.c|.cpp|.c++|.h|.[1-8]|.s|.y|.l &fff
# Any files with "rfc" at the start of the name are placed in
# "<FTP$Dir>.RFCs". Any files with "draft-" at the start of the name are
# placed in "<FTP$Dir>.IENs". Also path