跳到主要内容

5. ARCHIE

5.1. 什么是 ARCHIE​

archie 是一个信息系统.它提供一种电子目录服务,用于在国际 TCP/IP 网络(Internet)中定位信息.archie 最著名的用途是扫描一个包含全球 1000 多个匿名 FTP 站点内容的数据库.目前,该数据库包含来自匿名 FTP 站点的 2,100,000 多个文件名.该数据库称为 archie 数据库.匿名 FTP 站点提供的文件包括适用于各种系统(Windows, MS-DOS, Macintosh, Unix 等)的软件包,实用程序,信息或文档文件,邮件列表或 Usenet 组讨论档案.在大多数 FTP 站点,资源按目录和子目录分层组织.该数据库同时记录目录路径和文件名.archie 数据库会自动更新,从而确保信息的准确性.利用这个数据库,用户可以轻松找到所需文件的位置,而无需登录多台机器.

5.2. 谁可以使用 ARCHIE​

任何网络上的用户都可以通过电子邮件访问 archie 数据库.Internet 上的用户还可以使用其他访问方式(详细信息见下面 Using ARCHIE 一节).向 archie 服务器请求信息时,请你遵守几条基本规则:* 避免在工作时间连接;大多数 archie 服务器不是专用机器,它们也有本地职能.* 使你的查询尽可能具体;响应会更快更简短.* 安装在你计算机上的用户界面有助于减少服务器站点的负载,请使用它们.* 使用离你最近的 archie 服务器,尤其不要让跨大西洋线路过载.

5.3. 如何访问 ARCHIE​

archie 数据库维护在以下位置:

+---------------------------------------------------------------+
| |
| Host Country |
| |
+---------------------------------------------------------------+
| archie.au Australia |
| archie.edvz.uni-linz.ac.at Austria |
| archie.univie.ac.at Austria |
| archie.uqam.ca Canada |
| archie.funet.fi Finland |
| archie.th-darmstadt.de Germany |
| archie.doc.ic.ac.uk Great-Britain |
| archie.ac.il Israel |
| archie.unipi.it Italy |
| archie.wide.ad.jp Japan |
| archie.kyoto-u.ac.jp Japan |
| archie.hana.nm.kr Korea |
| archie.sogang.ac.kr Korea |
| archie.nz New Zealand |
| archie.rediris.es Spain |
| archie.luth.se Sweden |
| archie.switch.ch Switzerland |
| archie.ncu.edu.tw Taiwan |
| archie.ans.net USA |
| archie.internic.net USA |
| archie.rutgers.edu USA |
| archie.sura.net USA |
| archie.unl.edu USA |
| |
+---------------------------------------------------------------+

访问 archie 数据库有三种方式:通过本地客户端,交互式 Telnet 会话或电子邮件.每种访问方式都在下面 Using ARCHIE 一节中描述.

5.4. 使用 ARCHIE​

参数的格式在本节末尾给出.尖括号(<>)表示可选参数;竖线 (|) 表示参数的选择.注意:archie 服务器的新版本 (3.0) 现已可用.交互式访问和电子邮件接口的某些命令与以前版本的服务器 (2.11 及更早版本) 略有不同.标有 (+) 的命令格式仅在 3.0 版中有效,标有 (*) 的仅在以前版本中可用.要查明你希望使用的服务器上安装的是哪个版本,请发出 version 命令.

5.4.1. 使用本地客户端:​

鼓励使用这些客户端,因为它们提供对 archie 服务器的快速简便的非交互式访问,从而使服务器性能更好,用户响应时间更短.用于访问 archie 服务器的公共领域客户端可用于以下平台:Macintosh, MS-DOS, OS/2, VMS, NeXT, Unix 和 X-Windows.这些客户端可通过匿名 FTP 从 archie 站点的 /pub/archie/clients 或 /archie/clients 目录获得.所有这些平台都支持简单的命令行客户端.此外,X-Windows 还提供了图形界面(称为 xarchie).

5.4.1.1. Archie 客户端命令和参数​

使用图形界面时,你通过按鼠标按钮访问 archie 功能.结果显示时带有可选择的字段以便进一步探索.基本的 archie 客户端是你在本地机器上输入的一个带参数的命令.对于大多数版本的 archie 客户端,如果你不带参数键入 archie,你将得到可能参数的列表及每个参数的简短说明.命令的格式是:

+---------------------------------------------------------------+
| |
| archie <-options> string | pattern |
| |
+---------------------------------------------------------------+

其中选项有:o 指定一个输出文件名来存储结果(并非所有客户端都可用).l 列出结果,每行一个匹配项.这种形式适合程序解析.t 按日期倒序排列结果 m# 指定要返回的最大匹配数(# 的范围为 0 到 1000).默认值为 95.h archie-server 指定要发送查询的 archie 服务器;如果未给出此参数,则查询将发送到默认的 archie 服务器(如果有定义).L 列出已知服务器和当前默认服务器.下面这组选项决定在数据库上执行的搜索类型.它们相互排斥.s 如果文件/目录名包含 string 则匹配.搜索不区分大小写.c 与上面相同,但搜索区分大小写.e string 必须与数据库中的文件/目录名完全一致(包括大小写).这是默认的搜索方法.r 使用 pattern 搜索数据库.它包含在执行搜索前必须解释的特殊字符.不同平台上不同客户端可用的选项可能略有差异.结果是一个 FTP 站点地址列表,其中包含与参数匹配的文件或目录,文件大小,最后修改日期及其所在目录.默认情况下,列表按主机地址排序.有关 archie 输出的示例,请见下面的 Examples 一节.

5.4.2. 使用 Telnet:​

要以交互方式访问 archie 服务器,请 telnet 到现有服务器之一(见上面 How to get to ARCHIE 一节中的服务器列表).在 login: 提示符处输入 archie,登录过程结束后用户将看到 archie> 提示符.服务器已准备好接受用户请求.可以使用以下命令:exit, quit, bye 退出 archie.help 调用在线帮助.如果带 commandname 发出,帮助请求将限于指定主题.按 RETURN 键退出在线帮助.list 提供数据库中站点及其最后更新时间的列表.可选参数将列表限制为与 pattern 匹配的站点.结果是站点名称,站点 IP 地址和数据库中最后更新日期的列表.不带 pattern 的 list 命令将列出数据库中的所有站点(1000 多个站点!).例如,list .de$ 将列出所有德国站点 site(*) site-name 列出数据库中 site-name 的目录,并递归列出其子目录.结果可能很长.whatis string 在软件包描述数据库中搜索 string.搜索不区分大小写.

prog  string  |  pattern
find(+) string | pattern
searches the database for string or pattern which represents
the name of the resource to be found in the database. Searches
may be performed in a number of different ways specified in the
variable search (set command) which also decides the
interpretation of the parameter as string or pattern. The
result is a list of FTP site addresses with matching entries,
the size of the resource, its last modification date and the
directory to find it. The number of hits is limited by the
maxhits variable (set command). The result of prog can be
sorted in different ways, depending on the value of the sortby
variable (set command). By default, the variables search,
maxhits and sortby are set to, respectively, exact match search
on string, 1000 hits and unsorted resulting list. Typing the
keyboard interrupt character during a search will abort it. The
results up to that time are displayed. See the Examples section
below for an example of the prog command and its results.

mail <email> <,email2...>
sends the result of the last command in a mail message to the
specified e-mail address(es). If issued with no argument, the
result is sent to the address specified in the variable mailto
(set command).

show 显示给定变量名的值.如果不带参数发出,则显示所有变量.有关可能的变量,请见下面的 set 命令.

set  variable  value
sets one of the archie's variables. Values of these variables
affect how archie interacts with the user.

变量及其值为:compress(+) compress-method 指定在用 mail 命令邮寄结果之前要使用的压缩方法(none 或 compress).默认值为 none.encode(+) encode-method 指定在用 mail 命令邮寄结果之前要使用的编码方法(none 或 uuencode).如果未设置 compress,则忽略此变量.默认值为 none.

mailto  email  <,email2 ...>
specifies the e-mail address(es) to mail the result of the last
command when mail is issued with no arguments.

maxhits number 指定 prog 将生成的最大匹配数(范围 0 到 1000).默认值为 1000.search search-value 决定命令 prog string | pattern 在数据库上执行的搜索类型.search-values 有:sub 用 string 在数据库上执行部分且区分大小写不敏感的搜索,例如:"is" 将匹配 "islington","this" 和 "poison" subcase 与上面相同,但搜索区分大小写,例如:"TeX" 将匹配 "LaTeX" 但不匹配 "Latex" exact prog 的参数 (string) 必须与数据库中的字符串完全一致(包括大小写).这是所有搜索方法中最快的,也是默认方法.regex pattern 在数据库上执行搜索之前先被解释.sortby sort-value 描述如何对 prog 的结果排序.sort-values 有:hostname 按 FTP 站点地址的词典顺序.time 按修改日期,最新的在前.size 按找到的文件或目录的大小,最大的在前.filename 按文件或目录名的词典顺序.none 不排序(默认).通过在你给出的 sortby 值前加 r 可以获得与这里描述的相反的排序顺序.(例如,反向 hostname 顺序为 rhostname).

term  terminal-type   <number-of-rows  <number-of-columns>>
tells the archie server what type of terminal you are
using, and optionally its size in rows and columns, e.g.:

set term xterm 24 100

5.4.3. 使用电子邮件:​

只能使用电子邮件的用户可以通过向 How to get to ARCHIE 一节中列出的某个服务器的域名地址发送邮件来访问 archie 服务器(例如 [email protected]).命令在邮件的正文中发送.archie 服务器的电子邮件接口识别 Using Telnet 中描述的命令的一个子集.最有用的命令以及电子邮件接口特有的细节在下面描述.如果收到空消息,或不包含有效请求的消息,它将被视为帮助请求.命令行从第一列开始.所有与有效命令不匹配的行都将被忽略.Subject: 行被当作消息正文的一部分来处理.help 向你发送帮助文件.help 命令是独占的,即同一邮件中的其他命令将被忽略.path return-address set mailto(+) return-address 指定一个与从邮件头中提取的地址不同的回复电子邮件地址.如果你在几个小时内没有收到 archie 服务器的回复,可能需要在请求消息中添加一条 path 命令.

list  pattern  <pattern2 ...>
provides a list of the sites in the database that match pattern
and the time at which they were last updated. The result is a
list with site names, sites IP address and date of the last
update in the database.

site(*) site-name 列出数据库中 site-name 的目录,并递归列出其子目录.

whatis  string  <string2 ...>
searches the database of software packages descriptions for
each string. The search is case insensitive.

prog pattern <pattern2 ...>
find(+) pattern <pattern2>
searches the database for each interpretation of pattern which
represents the name of a resource to be found in the database.
If multiple patterns are placed on one line, in that case, the
results will be mailed back in one message. If multiple prog
lines appear, then multiple messages will be returned, one for
each prog line. Results are sorted by FTP site address in
lexical order. If pattern contains spaces, it must be quoted
with single (') or double (") quotes. The search is case
insensitive.

compress(*) 使当前请求的结果被压缩并进行 uuencode 编码.收到回复时,你应该用 uudecode 处理它.这将产生一个 .Z 文件.然后你可以对该文件运行 uncompress,得到你的请求结果 set compress(+) compress-method 指定在用邮件发送当前请求结果之前要使用的压缩方法(none 或 compress).默认值为 none.set encode(+) encode-method 指定在用邮件发送当前请求结果之前要使用的编码方法(none 或 uuencode).如果未设置 compress,则忽略此变量.默认值为 none.注意:set compress compress 和 set encode uuencode 会产生与以前的 compress 命令相同的结果.quit 此点之后的任何内容都不被解释.当你的邮件消息末尾自动附加签名时很有用.pattern 的描述 pattern 描述一个字符串,其中包含具有特殊含义的字符.当在字符前加 "" 时,其特殊含义消失.特殊字符有:. (句点) 这是通配符,可替代任何其他字符,例如 "...." 将匹配任何 4 字符的字符串.^ (插入符) 如果 "^" 出现在模式的开头,则被搜索的字符串必须以 "^" 后面的子串开头.如果它出现在模式的其他任何位置,则视为非特殊字符,例如:"^efghi" 将匹配 "efghi" 或 "efghijlk",但不匹配 "abcefghi" $ (美元符) 如果 "$" 出现在模式的末尾,则被搜索的字符串必须以 "$" 前面的子串结尾.如果它出现在模式的其他任何位置,则视为非特殊字符,例如:"efghi$" 将匹配 "efghi" 或 "abcdefghi",但不匹配 "efghijkl"

5.5. 示例​

如果你使用 archie 客户端,并输入命令:archie -s eudora 或者通过电子邮件或在 Telnet 会话中发送命令:prog eudora 或 find eudora 那么 archie 将向你发送以下结果:Host ftp.ascii.co.jp (133.152.1.1) Last updated 03:38 8 Aug 1993

Location: /pub/MAC
DIRECTORY drwxrwxr-x 2048 bytes 00:00 6 May 1992 eudora

Host ftp.ascii.co.jp (133.152.1.1) Last updated 03:38 8 Aug 1993 Location: /pub/MAC/eudora FILE -r--r--r-- 281139 bytes 00:00 21 Oct 1991 eudora1.2.2.sit.hqx Host ftp.ci.ua.pt (192.80.21.201) Last updated 04:53 9 Aug 1993

Location: /pub/NetNews/comp.binaries.mac
FILE -rw-r--r-- 438 bytes 12:04 10 Jul 1993 Eudora1.3.readme

Host ftp.ci.ua.pt (192.80.21.201) Last updated 04:53 9 Aug 1993

Location: /pub/NetNews/comp.binaries.mac
FILE -rw-r--r-- 278912 bytes 12:04 10 Jul 1993 Eudora1.3.sit.bin

等等.如果你通过电子邮件或在 Telnet 会话中发送命令 list .de$,那么你将得到以下结果:

alice.fmi.uni-passau.de          132.231.1.180  12:31  8 Aug 1993
askhp.ask.uni-karlsruhe.de 129.13.200.33 12:25 8 Aug 1993
athene.uni-paderborn.de 131.234.2.32 15:21 6 Aug 1993
bseis.eis.cs.tu-bs.de 134.169.33.1 00:18 31 Jul 1993
clio.rz.uni-duesseldorf.de 134.99.128.3 12:10 8 Aug 1993
cns.wtza-berlin.de 141.16.244.4 16:08 31 Jul 1993

等等.如果你通过电子邮件或在 Telnet 会话中发送命令 whatis compression,那么你将得到以下结果:RFC 468 Braden, R.T. FTP data compression 1973 March 8; 5p. arc PC compression program deltac Image compression using delta modulation spl Splay tree compression routines squeeze A file compression program uncrunch Uncompression program unsqueeze Uncompression programs

5.6. 了解更多 ARCHIE 信息​

无论你用什么方式与 archie 服务器通信,都可以使用在线帮助.如果你对 archie 有任何疑问,请写信给 Bunyip Information Systems Inc. 的 Archie Group,地址为 [email protected].错误报告,意见,建议等应邮寄至 [email protected].此外,特定 archie 站点的数据库管理员可通过 [email protected] 联系,例如:[email protected].邮件列表:[email protected] 订阅请发送邮件至:[email protected] Archie 由加拿大麦吉尔大学计算中心的 Alan Emtage,Peter Deutsch 和 Bill Heelan 开发.现在 archie 由加拿大 Bunyip Information System Inc. 支持.