2010-07-08 22:03:41 +04:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2017-10-01 14:21:40 +03:00
< html xmlns = "http://www.w3.org/1999/xhtml" lang = "zh-CN" xml:lang = "zh-CN" >
2010-07-08 22:03:41 +04:00
< head >
<!--
*
* Copyright 2008-2009, Haiku. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Humdinger < humdingerb @ gmail . com >
* Translators:
2010-08-02 20:51:09 +04:00
* Humdinger
2018-09-26 08:46:30 +03:00
* Pengphei Han
2010-07-08 22:03:41 +04:00
*
-->
< meta http-equiv = "content-type" content = "text/html; charset=utf-8" / >
< meta http-equiv = "Content-Style-Type" content = "text/css" / >
< meta name = "robots" content = "all" / >
< title > Attributes( 属性) < / title >
2017-10-01 14:21:40 +03:00
< meta name = "viewport" content = "width=device-width, initial-scale=1.0" / >
2010-07-08 22:03:41 +04:00
< link rel = "stylesheet" type = "text/css" href = "../Haiku-doc.css" / >
< / head >
< body >
< div id = "banner" >
2018-09-26 08:46:30 +03:00
< div > < span > 用户指南< / span > < / div >
2010-07-08 22:03:41 +04:00
< / div >
< div class = "nav" >
< div class = "inner" >
< ul class = "lang-menu" >
< li class = "now" > < img src = "../images/flags/zh_CN.png" alt = "" / > 中文 [中文]< / li >
2017-06-24 01:19:23 +03:00
< li > < a href = "../ca/attributes.html" > < img src = "../images/flags/ca.png" alt = "" / > Català< / a > < / li >
2010-07-08 22:03:41 +04:00
< li > < a href = "../de/attributes.html" > < img src = "../images/flags/de.png" alt = "" / > Deutsch< / a > < / li >
2017-06-24 01:19:23 +03:00
< li > < a href = "../en/attributes.html" > < img src = "../images/flags/gb.png" alt = "" / > English< / a > < / li >
2010-07-08 22:03:41 +04:00
< li > < a href = "../es/attributes.html" > < img src = "../images/flags/es.png" alt = "" / > Español< / a > < / li >
2017-06-24 01:19:23 +03:00
< li > < a href = "../fr/attributes.html" > < img src = "../images/flags/fr.png" alt = "" / > Français< / a > < / li >
< li > < a href = "../it/attributes.html" > < img src = "../images/flags/it.png" alt = "" / > Italiano< / a > < / li >
2012-11-16 01:36:54 +04:00
< li > < a href = "../hu/attributes.html" > < img src = "../images/flags/hu.png" alt = "" / > Magyar< / a > < / li >
2014-05-31 02:02:36 +04:00
< li > < a href = "../pl/attributes.html" > < img src = "../images/flags/pl.png" alt = "" / > Polski< / a > < / li >
2017-06-24 01:19:23 +03:00
< li > < a href = "../pt_PT/attributes.html" > < img src = "../images/flags/pt_PT.png" alt = "" / > Português< / a > < / li >
< li > < a href = "../pt_BR/attributes.html" > < img src = "../images/flags/pt_BR.png" alt = "" / > Português (Brazil)< / a > < / li >
2016-05-06 05:15:13 +03:00
< li > < a href = "../ro/attributes.html" > < img src = "../images/flags/ro.png" alt = "" / > Română< / a > < / li >
2017-06-24 01:19:23 +03:00
< li > < a href = "../sk/attributes.html" > < img src = "../images/flags/sk.png" alt = "" / > Slovenčina< / a > < / li >
< li > < a href = "../fi/attributes.html" > < img src = "../images/flags/fi.png" alt = "" / > Suomi< / a > < / li >
< li > < a href = "../sv_SE/attributes.html" > < img src = "../images/flags/sv_SE.png" alt = "" / > Svenska< / a > < / li >
< li > < a href = "../ru/attributes.html" > < img src = "../images/flags/ru.png" alt = "" / > Русский< / a > < / li >
< li > < a href = "../uk/attributes.html" > < img src = "../images/flags/uk.png" alt = "" / > Українська< / a > < / li >
< li > < a href = "../jp/attributes.html" > < img src = "../images/flags/jp.png" alt = "" / > 日本語< / a > < / li >
2010-07-08 22:03:41 +04:00
< / ul >
< span >
2010-08-02 20:51:09 +04:00
« < a href = "filetypes.html" > 文件类型< / a >
2018-09-26 08:46:30 +03:00
:: < a href = "contents.html" class = "uplink" > 内容< / a >
2010-07-08 22:03:41 +04:00
:: < a href = "index.html" > 索引< / a > »
< / span > < / div >
< / div >
< div id = "content" >
< div >
< h1 > Attributes( 属性) < / h1 >
< p > 属性是一些数据段,它们属于文件,但却不是文件的组成部分,例如:它们不计入文件的大小,而且可以在不改变文件本身的情况下,进行复制和修改。系统利用属性来储存文件信息,例如:文件大小,类型以及最近的修改日期。这与其他的系统和文件系统相类似。< / p >
< p > 所不同的是,您可以为文件添加任何类型的属性,并可以在 Tracker 窗口中显示和修改该属性。你只需要在文件类型中添加你所希望的属性类型(例如:字符串,整数或者时间),然后进行命名,给出相关的描述。< / p >
< p > 文件本身设置不需要任何的内容,请看下面 People 文件的例子:< / p >
< img src = "images/attributes-images/people.png" alt = "people.png" / >
< br / >
< p > 您可以看到,所有的零大小文件都有附加属性,而在 Tracker 中, “John Nox” 的 E-mail 属性正在进行修改。< / p >
< p > 如果您对这些属性做出索引,类似于 People, Email 或者音频文件默认的那样,它们在 Haiku 的快速查询系统中也可以查询到。< / p >
< h2 >
< a href = "#" > < img src = "../images/up.png" style = "border:none;float:right" alt = "index" / > < / a >
2010-08-02 20:51:09 +04:00
< a id = "attributes-tracker" name = "attributes-tracker" > Tracker中的属性< / a > < / h2 >
2010-07-08 22:03:41 +04:00
< p > 属性的显示非常类似于数据库或者电子表格。利用Tracker, 你也可以选择显示哪些属性( 列) , 并依此来对文件( 行) 进行分类。< / p >
< p > 为此,打开一个 Tracker 窗口,点击 < span class = "menu" > Attributes< / span > 菜单,选择希望显示的属性。或者,右键点击列标题,然后在快捷菜单中标记该项目。您可以通过简单的拖拽来进行纵列排序;降序排列标题。最快的移除您不需要的列的方式是直接从窗口中移出该列。< / p >
< p > 双击标题中两个属性之间的竖线,可以自动地对列的宽度进行最佳的调整。< / p >
< p > 您可以通过点击列标题来进行升序或者降序的排列 您也可以在点击列标题的同时按下 < span class = "key" > SHIFT< / span > 键来进行二次排序。 例如,你可以在联系人姓名排序的基础上,再次通过公司来对你的 People 文件进行排序。以上面的截图为例,在标题中,二次排序以较浅的颜色进行了标记。< / p >
< p > 属性的编辑和修改文件名一样简单:点击该项或者按 < span class = "key" > ALT< / span > < span class = "key" > E< / span > 键,然后使用 < span class = "key" > TAB< / span > 和 < span class = "key" > SHIFT< / span > < span class = "key" > TAB< / span > 键在属性之间移动。按下 < span class = "key" > ESC< / span > 键,退出编辑状态,不执行修改。< / p >
< h2 >
< a href = "#" > < img src = "../images/up.png" style = "border:none;float:right" alt = "index" / > < / a >
2010-08-02 20:51:09 +04:00
< a id = "attributes-terminal" name = "attributes-terminal" > 终端中的属性< / a > < / h2 >
2010-07-08 22:03:41 +04:00
< p > 如果你喜欢使用命令行,或者计划使用脚本来处理较多的文件,那么在 Terminal 中有一些可用于控制属性的命令。< / p >
< h3 >
< a href = "#" > < img src = "../images/up.png" style = "border:none;float:right" alt = "index" / > < / a >
< a id = "listattr" name = "listattr" > listattr< / a > < / h3 >
< p > < span class = "cli" > listattr< / span > 命令列出了文件的属性,但不显示属性内容。< / p >
< pre > usage: listattr 'filename' ['filename' ...]< / pre >
< p > 上面我们的截图中的例子:< / p >
2018-09-26 08:46:30 +03:00
< pre class = "terminal" > ~/people -> listattr Clara\\ Botters
2010-07-08 22:03:41 +04:00
File: Clara Botters
Type Size Name
----------- --------- -------------------------------
MIME String 21 "BEOS:TYPE"
Text 14 "META:name"
Text 6 "META:nickname"
Text 1 "META:company"
Text 18 "META:address"
Text 8 "META:city"
Text 1 "META:state"
Text 1 "META:zip"
Text 1 "META:country"
Text 1 "META:hphone"
Text 13 "META:wphone"
Text 1 "META:fax"
Text 19 "META:email"
Text 1 "META:url"
Text 5 "META:group"
Raw Data 20 "_trk/pinfo_le"
131 bytes total in attributes.< / pre >
< p > 除了所有的 "< tt > META:*< / tt > " 属性用于显示联系方式,还有两个由系统管理的属性:< / p >
< ul >
< li > < p > < tt > BEOS:TYPE< / tt > 以 < acronym title = "Multipurpose Internet Mail Extensions" > MIME< / acronym > 字符串的形式保存文件类型,保存于 "< tt > application/x-person< / tt > " 。它决定了默认的图标以及当你双击打开该文件时所要运行的程序。< / p > < / li >
< li > < p > "< tt > _trk/pinfo_le< / tt > " 是一个位置属性, Tracker 可以通过它来跟踪文件图标的位置。< / p > < / li > < / ul >
2018-09-26 08:46:30 +03:00
< div class = "box-info" > 需要注意的是 "Clara" 之后的反斜杠。在 Terminal 中您必须 "避开" 特殊字符,例如 < tt > '"*\\$?!< / tt > ;同时,处于 "Clara" 和 "Botters" 之间的空格也属于此类字符。所以反斜杠真实的出现在空格字符之前,而不是 "Clara" 之后。< / div >
2010-07-08 22:03:41 +04:00
< h3 >
< a href = "#" > < img src = "../images/up.png" style = "border:none;float:right" alt = "index" / > < / a >
< a id = "catattr" name = "catattr" > catattr< / a > < / h3 >
< p > < span class = "cli" > catattr< / span > 命令显示了文件特有属性的内容。< / p >
< pre > usage: catattr [--raw|-r] attr_name file1 [file2...]< / pre >
< p > 还是上面的例子:< / p >
2018-09-26 08:46:30 +03:00
< pre class = "terminal" > ~/people -> catattr META:city Clara\\ Botters
2010-07-08 22:03:41 +04:00
Clara Botters : string : Whelton< / pre >
< h3 >
< a href = "#" > < img src = "../images/up.png" style = "border:none;float:right" alt = "index" / > < / a >
< a id = "addattr" name = "addattr" > addattr< / a > < / h3 >
< p > < span class = "cli" > addattr< / span > 命令用于为文件添加属性,并进行赋值。< / p >
< pre > usage: addattr [-t type] attr value file1 [file2...]
or: addattr [-f value-from-file] [-t type] attr file1 [file2...]
Type is one of:
2010-08-02 20:51:09 +04:00
string, mime, int, llong, float, double, bool, icon, raw
2010-07-08 22:03:41 +04:00
or a numeric value (ie. 0x1234, 42, 'ABCD', ...)
The default is "string"< / pre >
< p > 所以当亲爱的 Clara 在跨国公司 Barkelbaer Inc.找到了工作,你就可以为原本空白的 "Company" 属性补充该数据 (而此数据也属于 "string" 类型): < / p >
2018-09-26 08:46:30 +03:00
< pre class = "terminal" > ~/people -> addattr -t string META:company Barkelbaer\\ Inc. Clara\\ Botters< / pre >
2010-07-08 22:03:41 +04:00
< h3 >
< a href = "#" > < img src = "../images/up.png" style = "border:none;float:right" alt = "index" / > < / a >
< a id = "rmattr" name = "rmattr" > rmattr< / a > < / h3 >
< p > < span class = "cli" > rmattr< / span > 命令用于从文件中完全移除其某一属性。< / p >
< pre > usage: rmattr [-p] attr filename1 [filename2...]
'attr' is the name of an attribute of the file
If '-p' is specified, 'attr' is regarded as a pattern.< / pre >
< p > 即使不填写 "Fax" 属性,在实际应用中也已经足够了;所以你可以通过键入下面的命令来从 Clara 文件中完全删除它:< / p >
2018-09-26 08:46:30 +03:00
< pre class = "terminal" > ~/people -> rmattr META:fax Clara\\ Botters< / pre >
2010-07-08 22:03:41 +04:00
< h3 >
< a href = "#" > < img src = "../images/up.png" style = "border:none;float:right" alt = "index" / > < / a >
< a id = "copyattr" name = "copyattr" > copyattr< / a > < / h3 >
< p > < span class = "cli" > copyattr< / span > 命令用于从一些文件向另一些文件拷贝属性。默认情况下,文件的实际内容并< b > 没有< / b > 进行拷贝。< / p >
< pre > Usage: copyattr < options> < source> [ ... ] < destination> < / pre >
< p > 如果您希望完全拷贝文件的属性及其数据文件,你可以在命令后添加 "< span class = "cli" > -d< / span > " 或者 "< span class = "cli" > --data< / span > " 来完成。< / p >
< p > < br / > < / p >
< p > 更多有关这些命令和它们的参数选项的信息,您可以通过键入命令名,然后辅以 "< span class = "cli" > -h< / span > " 或者 "< span class = "cli" > --help< / span > " 选项来获取。< / p >
< / div >
< / div >
< div class = "nav" >
< div class = "inner" > < span >
2010-08-02 20:51:09 +04:00
« < a href = "filetypes.html" > 文件类型< / a >
2018-09-26 08:46:30 +03:00
:: < a href = "contents.html" class = "uplink" > 内容< / a >
2010-07-08 22:03:41 +04:00
:: < a href = "index.html" > 索引< / a > »
< / span > < / div >
< / div >
< / body >
< / html >