关于FTP协议的LIST问题,懂的高手快进来拿分,不懂的进来学学。 (100分)

  • 主题发起人 主题发起人 Writer
  • 开始时间 开始时间
W

Writer

Unregistered / Unconfirmed
GUEST, unregistred user!
LIST一个目录或文件时,服务器返回的是像下面的内容一样的信息,

drw-rw-rw- 1 user group 0 Dec 9 14:59 .
drw-rw-rw- 1 user group 0 Dec 9 14:59 ..
-r--r--r-- 1 user group 37663 Mar 28 2001 hello.zip
-rw-rw-rw- 1 user group 2993875 Dec 9 14:55 susetup.exe

我知道每一行的字符串的第一个字符为d则是目录,最后三个字段分别是文件大小,日期,
文件名,其它的呢??那些user,group到底是什么?我查过RFC959没有找到相关的资料,
有没RFC说名这个规范?
 
这是UNIX下的ls命令的输出格式,
Column 2 - Number of links
Column 3 - Owner of the file. Normally the owner of the file is the user account
that originally created it.

Column 4 - Group under which the file belongs. This is by default the group to
which the account belongs or first three letters of the userid. The group can be
changed by the chgrp command.

Column 5 - Size of file (bytes).

Column 6 - Date of last update

Column 7 - Name of file
这是一篇关于其输出内容的文章
http://www.gsu.edu/~wwwhcs/DOCS/Unix/lsunix.html

下面贴出文章的内容
The LS Command on UNIX
The ls command lists the files in your current working directory. When you log
onto your account on UNIX, your current working directory is your home or
personal directory. This is the directory in which you have personal disk space
to put files on or to create sub-directories under. The ls command also has
options available. Options follow the hyphen ( - ) sign. Two of the most useful
options are a (return all files, even "hidden") and l (give long or full file
information). The ls command also accepts strings with the asterisk * used as a
"wildcard" to tell UNIX to search for all files that contain the specified sub
-string.

Example

$ ls -al *test*

-rw-r--r-- 1 hcsdar usg 592 Sep 1 1993 .test
drwx------ 2 hcsdar usg 512 Nov 11 16:21 dirtest
-rw-r--r-- 2 hcsdar usg 1097 Nov 2 1993 test
-rw------- 1 hcsdar usg 1097 Oct 19 15:54 test.bin
-rw------- 1 hcsdar usg 1216 Jul 15 1993 test.fil

What Does This Tell You?
Columns
1 2 3 4 5 6 7
-rw-r--r-- 1 hcsdar usg 592 Sep 1 1993 .test
drwx------ 2 hcsdar hcs 512 Nov 11 16:21 dirtest

Column 1



Column 1 tells you the type of file, what privileges it has and to whom these
privileges are granted. There are three types of privileges. Read and write
privileges are easy to understand. The exec privilege is a little more
difficult. You can make a file "executable" by giving it exec privileges. This
means that commands in the file will be executed when you type the file name in
at the UNIX prompt. It also means that when a directory which, to UNIX is a file
like any other file, can be "scanned" to see what files and sub-directories are
in it. Privileges are granted to three levels of users:

1) the owner of the file. The owner is usually, but not always, the userid that
created the file.
2) the group to which the owner belongs. At GSU, the group is usually, but not always
designated as the first three letters of the userid of the owner.
3) everybody else who has an account on the UNIX machine where the file resides.
Column 2 - Number of links
Column 3 - Owner of the file. Normally the owner of the file is the user account
that originally created it.

Column 4 - Group under which the file belongs. This is by default the group to
which the account belongs or first three letters of the userid. The group can be
changed by the chgrp command.

Column 5 - Size of file (bytes).

Column 6 - Date of last update

Column 7 - Name of file

Other Handouts on UNIX
The chmod Command
Changing Directories on UNIX

Help Center Services
June 19, 1995
DAR/DRF
lsunix.027
 
那么请问知不知为什么现在的服务器都用这个格式?
 
接受答案了.
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
711
import
I
I
回复
0
查看
545
import
I
I
回复
0
查看
805
import
I
后退
顶部