专 题:列出、改变目录
主 讲:qianqian
列出目录
你可以使用DIR命令来列出目录。实际上,DIR并不是FTP规定的命令,但是标准的用户界面从操作系统借用了这个命令。
图2 显示了DIR命令的结果。最右边是文件或目录的名称,然后是文件日期和时间。然后是10位的文件属性。你可以通过"d"属性分别目录或文件。如果是"d",表示这是个目录。
改变目录
你可以通过CD命令改变目录。和DOS命令的区别是它使用正斜杠。例如改变目录到 /developr/vb directory:
ftp> cd developr/vb
250 CWD command successful.
再次使用DIR命令,你可以获得文件列表。图3 显示了 DIR命令在ftp.microsoft.com的 /developr/vb 目录的执行结果。
图 2 DIR命令
ftp>dir
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
d----- 1 owner group 0 Jul 3 13:52 bussys
d----- 1 owner group 0 Aug 9 3:00 deskapps
d----- 1 owner group 0 Oct 27 7:35 developr
----- 1 owner group 7905 Oct 5 8:53 dirmap.htm
----- 1 owner group 4510 Oct 5 8:52 dirmap.txt
----- 1 owner group 712 Aug 25 1994 disclaimer.txt
----- 1 owner group 860 Oct 5 1994 index.txt
d----- 1 owner group Aug 31 12:17 KBHelp
----- 1 owner group 7393252 Nov 28 4:04 ls-lR.txt
----- 1 owner group 914179 Nov 28 4:05 ls-lR.Z
----- 1 owner group 766409 Nov 28 4:04 LS-LR.ZIP
d----- 1 owner group 0 Oct 20 9:27 MSCorp
----- 1 owner group 28160 Nov 28 1994 MSNBRO.DOC
----- 1 owner group 22641 Feb 8 1994 MSNBRO.TXT
d----- 1 owner group 0 Oct 11 3:00 peropsys
d----- 1 owner group 0 Aug 23 21:55 Products
d----- 1 owner group 0 Oct 5 8:46 Services
d----- 1 owner group 0 Nov 22 14:38 Softlib
----- 1 owner group 5095 Oct 20 1993 support-phones.txt
----- 1 owner group 802 Aug 25 1994 WhatHappened.txt
226 Transfer complete.
1407 bytes received in 0.99 seconds (1.42 Kbytes/sec)
图 3 Microsoft的/developr/vb directory目录
ftp> dir
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
d----- 1 owner group 0 Oct 25 6:39 kb
d----- 1 owner group 0 Feb 24 11:35 public
----- 1 owner group 1571 Aug 24 1994 README.TXT
d----- 1 owner group 0 Aug 24 1994 unsup-ed
226 Transfer complete.
270 bytes received in 0.22 seconds (1.23 Kbytes/sec)
(千千VB站整理 转载请保留此信息)
[url=http://dev.csdn.net/javascript:window.close()][/url]