Inferno man pages -1 - fs / Руководство по ОС Inferno - раздел 1 - fs

→fs bundle {merge -c {compose AinB} . {unbundle old.bundle}} > new.bundle
0 fs bundle {merge -c {compose AinB} . {unbundle old.bundle}} > new.bundle
→Create a new archive containing those files from below the current directory that were held in an old archive:
0 Создает новый архив содержащий файлы ниже текущей директории которые хранились в старом архиве:
→fs exec @{rm $file} {select {query
@{echo -n $file:; ~ {read} y yes}}
{select {mode -d} {filter {depth 1} .}}}
0 fs exec @{rm $file} {select {query
@{echo -n $file:; ~ {read} y yes}}
{select {mode -d} {filter {depth 1} .}}}
→Interactively remove all regular files from one level of the current directory:
0 Интерактивно удаляет все обычные файлы одного уровня теукщей директории:
→fs write /tmp/foo .
0 fs write /tmp/foo .
→A simpler method of the above:
0 Упрощенный случай предыдущего:
→fs bundle . | fs write /tmp/foo {unbundle -}
0 fs bundle . | fs write /tmp/foo {unbundle -}
→Recursively copy the current directory to /tmp/foo.
0 Рекурсивно копирует текущую директорию в /tmp/foo:
→fs exec @{rm $file} {select *.dis /appl}
0 fs exec @{rm $file} {select *.dis /appl}
→Remove all files from /appl ending in .dis:
0 Удаляет все файлы заканчивающиеся на .dis из /appl:
→fs select {mode -d} {merge -c {compose -d AoutB} x y}
0 fs select {mode -d} {merge -c {compose -d AoutB} x y}
→Show the names of all files in x that aren't in y:
0 Показывает имена всех файлов x не являющиеся y:
→string->fs
The result is {walk string}.
fs->entries
The result is {entries fs}.
string->gate
The result is {match string}.
entries->void
The result is {print entries}.
command->string
The result is {run command}.
0 string->fs
Результат {walk string}.
fs->entries
Результат {entries fs}.
string->gate
Результат {match string}.
entries->void
Результат {print entries}.
command->string
Результат {run command}.
→As a convenience, fs carries out some automatic type conversions (conversions are applied recursively, so for instance, an fs-valued expression at the top level will converted to void by applying {print {entries fs}}.
0 По соглашению, fs выполняет автоматическое преобразование типов (преобразования выполняются рекрсивно, так например, fs выражение верхнего уровня будет сконвертировано в void путем {print {entries fs}).
→EXAMPLES
Print the size of all files below the current directory:
0 ПРИМЕРЫ
Печать размеров всех файлов в текущей директории и ниже:
→fs size .
0 fs size .
→and gate gate [gate...] -> gate
And is a gate that is open to an entry if all its arguments are open.
bundle fs -> void
Bundle converts fs to an archival format and writes it to the standard output.
compose [-d] op -> selector
Compose implements compositing''-style operators, useful when merging filesystems. Op specifies the operator, taking its name from the graphical Porter-Duff equivalent: AinB, AinB, BinA, AoutB, BoutA, A, AoverB, AatopB, AxorB, B, BoverA, or BatopA. For instance, AinB gives the intersection of A and B; AatopB gives A whereever both A and B exist, and B otherwise. When used as a selector for merge, operators that exclude the union of A and B are not very useful, as they will exclude all common directories at the top level. Given the -d option, compose will allow through directories that would otherwise be excluded in this way, making operators such as AxorB (all that A does not hold in common with B) more useful, although accurate only for regular files.
depth n -> gate
Depth is a gate open only to entries which are within n levels of the root of the filesystem.
entries fs -> entries
Entries produces all the entries contained within fs.
eval expr -> any
Eval evaluates an fs expression and yields its result.
filter [-d]gate fs -> fs
The result of filter is a filesystem from which all entries that will not pass through gate, and their descendents, have been removed. If the -d flag is given, only files are filtered - directories bypass the gate.
ls [-um] entries -> void
Print each entry in the style of ls -l (see ls(1)). If the -u flag is given, the file access time rather than the file modification time will be printed. If the -m flag is given, the name of the user that last modified the file is printed too.
exec [-pP] [-t command] [-n n] command entries -> void
Run its argument command for each entry in entries . If the -n flag is specified, exec will try to gather n entries together before invoking the command (default 1). The environent variable $file is set to the names of the entries that have been gathered. If the -p flag is given, environment variables are set giving information about the mode, owner, modification time and size of the entry (they are named after the equivalent field names in the Dir structure; see sys-stat(2)). This option is only valid when n is 1. The -P flag causes all the other fields in the Dir structure to be included too. Note that the command is run in the same shell context each time, so environment variable set on one execution can be retrieved on the next. The -t flag can be used to specify a command which will be executed just before termination.
match [-ar] pattern -> gate
Match is a gate that is open if the entry's filename matches the pattern. If the -a flag is given, the whole path will be used for the match. If -r is specified, the pattern is evaluated as a regular expression, otherwise it is a shell-style pattern in the style of filepat(2).
merge [-1] [-c selector] fs fs [fs...] -> fs
Recursively merge the contents of its argument filesystems. Selector is consulted to see which entries are chosen for the result; if not given, entries are resolved in favour of the first filesystem (equivalent to {compose AoverB}). If the -1 flag is given, merging takes place only in the top-level directory.
mode spec -> gate
Mode is a gate that lets through entries whose file permissions satisfy spec, which is a string in the style of chmod(1). If the op field is +, the specified permissions must be present; if -, they must be absent, and if =, they must be exactly as given. The directory and auth modes are specified with the characters d'' and A'' respectively.
not gate -> gate
Not is a gate open to an entry if its argument is not.
or gate gate [gate...] -> gate
Or is a gate open to an entry if any argument is open.
path [-x] path... -> gate
Path is a gate open to an entry whose full pathname is an ancestor or a descendent of any path. If -x is specified, the gate is open to any path except descendents of the paths given.
pipe [-1pP] command fs -> void
Pipe is similar to exec, except that the contents of all files in fs are piped through command. Unless the -1 option is given, command is started once for each file, with $file set to its name, and other environment variables set according to the -p or -P options, as for exec. If the -1 option is specified, command is started once only - all file data is piped through that.
print entries -> void
Print the path name of each entry.
proto [-r root] protofile -> fs
Evaluate protofile as a mkfs(8) proto file. If root is specified, it will be used as the root of the resulting fs.
query command -> gate
Query is a gate that runs command to determine whether it is open: an empty exit status from the command yields an open gate. The environment variable $file is set for the command to the path name of the entry that is being queried for.
run command -> string
Run runs command and substitutes the value of the environment variable $s after its invocation. $s must have exactly one element.
select gate entries -> entries
Select only those entries within entries that will pass through gate. Descendents of elided entries are not affected.
setroot [-c] path fs -> fs
Setroot sets the name of the root directory of fs. If the -c flag is given, the elements in the root directory will be made explicit in the hierarchy (i.e. the name of the top directory will not contain any / characters).
size entries -> void
Print the sum of the size of all entries, in bytes.
unbundle file -> fs
Unbundle reads an archive as produced by bundle from file; its result is the contents of the filesystem that was originally bundled. If file is -'', the standard input is read.
walk path -> fs
Walk produces a filesystem that's the result of traversing all the files and directories underneath path.
write dir fs -> void
Write the contents of fs to the filesystem rooted at dir . If dir is empty, fs will be written to the root directory originally associated with fs.
0 and gate gate [gate...] -> gate
And это гейт который открывает запись если все все аргументы открыты.
bundle fs -> void
Bundle конвертирует fs в архивный формат и пишет его на стандартный вывод.
compose [-d] op -> selector
Compose создает операторы "композитного/состовного"-типа, полезных в случае объединенных файловых систем. Op определяет оператор, беря имена из графического алгоритма Porter-Duff: AinB, AinB, BinA, AoutB, BoutA, A, AoverB, AatopB, AxorB, B, BoverA, or BatopA. Например, AinB дает пересечение множеств A и B; AatopB дает A если оба и A и B существуют, и B в противном случае. Когда используется как selector для объединения, операторы которые исключают объединение A и B не очень полезны, поскольку они исключают все общие директории верхнего уровня. Задание опции -d, позволяет compose проходить через директории которые в противном случае были бы исключены, делая операторы такие как AxorB (все А что не удовлетворяют равенства с B) более полезными, хотя правильно работает только с обычными файлами.
depth n -> gate
Depth это гейт открытый только для записей которые нахотяся в пределах n уровня от корня файловой системы.
entries fs -> entries
Entries выдает все записи содержащиеся в fs.
eval expr -> any
Eval вычисляет fs выражение и возвражает его результат.
filter [-d]gate fs -> fs
Результатом фильтра является файловая система из которой были удалены записи и их потомки не прошедшие гейт. Если был установлен флаг -d, будут фильтроваться только файлы, а директории продуйт через гейт.
ls [-um] entries -> void
Напечатает каждую запись в стиле ls -l (смотри ls(1)). Если задан флаг -d, то вместо времени модификации файла будет напечатано время последнего доступа к файлу. Если задан флаг -m, будет также напечатано имя пользователя модифицировавшего файл.
exec [-pP] [-t command] [-n n] command entries -> void
Запускает команду принимающую в качестве аргумента каждую запись из списка. Если указан флаг -n exec попытается собрать вместе n записей перед вызовом команды (по умолчанию - 1). Переменная окружения $file устанавливается в имена записей которые были собраны. Если задан флаг-p, переменным окружения присваивается информация о правах доступа, владельце, времени модификации и рамере записи (они называются аналогичными именами полей структуры Dir; смотри sys-stat(2)). Эта опция действует только в случае n равного 1. Флаг -P включает все другие поля из структуры Dir. Обратите внимание, что команда запускается каждый раз в том же самом контектсе интерпретатора, так что переменные окружения установленные для одного выполнения могут быть извлечены в следующий раз. Флаг -t может быть использован для указания команды которая будет выполнена перед завершением работы.
exec [-pP] [-t command] [-n n] command entries -> void
Запускает команду принимающую в качестве аргумента каждую запись из списка. Если указан флаг -n exec попытается собрать вместе n записей перед вызовом команды (по умолчанию - 1). Переменная окружения $file устанавливается в имена записей которые были собраны. Если задан флаг-p, переменным окружения присваивается информация о правах доступа, владельце, времени модификации и рамере записи (они называются аналогичными именами полей структуры Dir; смотри sys-stat(2)). Эта опция действует только в случае n равного 1. Флаг -P включает все другие поля из структуры Dir. Обратите внимание, что команда запускается каждый раз в том же самом контектсе интерпретатора, так что переменные окружения установленные для одного выполнения могут быть извлечены в следующий раз. Флаг -t может быть использован для указания команды которая будет выполнена перед завершением работы.
merge [-1] [-c selector] fs fs [fs...] -> fs
Рекурсивное объединение содержимого файловых систем указанных как аргументы. Selector задает правила отбора записей, в случае если он не задан, записи отбираются из предпочтений первой фалойвой системы (аналогично {compose AoverB}). Если указан флаг -1, объединение осуществляется только у директорий верхнего уровня.
mode spec -> gate
Mode это гейт который отбирает записи, чьи права удовлетворяют указанным, они записываются как строка в стиле chmod(1). если оператор поля является +, права должны быть представлены; если -, они должны отсутствовать, и если =, они должны в точности соответствовать заданным. Директории и режим аутентификации указываются символами d'' и A'' соответственно.
not gate -> gate
Not это гейт открытый для записей НЕ аргументов.
or gate gate [gate...] -> gate
Or это гейт открытый для записей если один из аргументов открыт.
path [-x] path... -> gate
Path это гейт открытый для записи чей полный путь является предком или потомком любого пути. Если указан -x, то гейт открыт для любого пути за исключением заданного.
pipe [-1pP] command fs -> void
Pipe похожа на exec, за исключением того, что содержимое всех файлов в fs пропускается через команду. Пока не задана опция -1, команда запускается один раз для каждого файла, с переменной $file содержащей имя файла, и другими переменными окружения установленными в соответствии с опциями -p или -P, как для exec. Если указана опция -1, команда выполняется всего один раз - все содержимое файлов пропускается через нее.
print entries -> void
Печатает путь каждой записи.
proto [-r root] protofile -> fs
Evaluate protofile as a mkfs(8) proto file. If root is specified, it will be used as the root of the resulting fs.
Вычисляет protofile как прото-файл mkfs(8). Если указан корень, он будет использован как корень результуирующей fs.

query command -> gate
Query это гейт который запускает команду для определения который из них открыт; пустой статус выхода команды считаеся окрытым гейтом. Пременная окружения $file устанавливается командой в путь к записи к которой произведено обращение.

run command -> string
Run runs command and substitutes the value of the environment variable $s after its invocation. $s must have exactly one element.
Run запускает команду и заменяет значение переменной окружения $s после ее вызова. $s должна быть точно лдним элементом.

select gate entries -> entries
Select отбирает только те записи которые проходят через гейт. На потомков это не распространяется.

setroot [-c] path fs -> fs
Setroot задает имя корневой директории fs. Если задан флаг -c, элементы корневой директории созданы явно в иерархии (например, имя верхней директории не будет содержать ни одного символа /).

size entries -> void
Выводит суммарный размер всех записей в байтах.

unbundle file -> fs
Unbundle читает архив созданный bundle из файла; его результатом будет содержимое оригинальной файловой системы помещенной в архив. Если файл является "-", считывается стандартный поток ввода.

walk path -> fs
Walk производит файловую систему являющуюся результатом обхода всех файлов и каталогов ниже заданного пути.

write dir fs -> void
Write записывает содержимое fs в файловую систему с корнем в dir. Если dir пуста, fs запишет корневую директорию первоначально ассоциированную с fs.
→With no arguments, fs prints a summary of the available verbs. Verbs understood by fs include:
0 Если fs выполняется без аргументов, она напечатает список доступных команд. Команды которые понимает fs включают в себя:
→describes a verb print, which takes one argument of type entries, and the result of which is of type void. If the type is not one of those described above, it should be taken to be of type string.
0 описывает команду print, которая принимает один аргумент типа entries, и результатом которой является тип void. Если тип не подходит ни под один из описанных, он должен быть строковым типом.
→print entries -> void
0 print entries -> void
Резюме
Пол:
мужчина
Родной язык:
русский
С нами:
с 13 апреля 2009 г. (6395 дней)
Деятельность:
1085 версий перевода с общим рейтингом 0
3 комментария
Карма: 2 (оценок: 2)
Написать rapidfx личное сообщение