URI-схема файла | Participants
|
- Statistics
- Participants
- Translate into Russian
- Translation result
- 50% translated in draft.
If you do not want to register an account, you can sign in with OpenID.
File URI scheme | ||
The file URI scheme is a URI scheme specified in RFC 1630 and RFC 1738, typically used to retrieve files from within one's own computer. | URI-схема файла — схема URI, определённая в документах RFC 1630 и RFC 1738. Как правило используется для обращения к файлам на своём компьютере. | |
Format | ||
A file URL takes the form of | ||
file://host/path | ||
where host is the fully qualified domain name of the system on which the path is accessible, and path is a hierarchical directory path of the form directory/directory/.../name. If host is omitted, it is taken to be "localhost", the machine from which the URL is being interpreted. Note that when omitting host you do not omit the slash ("file:///foo.txt" is okay, while "file://foo.txt" is not, although some interpreters manage to handle the latter). | где host — полное доменное имя системы, у которой запрашивается файл, а path — иерархический путь по каталогам в формате каталог/каталог/ ... /имя_файла. Если не будет указан host, он по умолчанию будет принят как "localhost", обозначающий компьютер, на котором вводят адрес. Следует иметь ввиду, что пропуская host, слэш при этом не пропускается. То есть "file:///foo.txt" — правильно, "file://foo.txt" — неправильно. Тем не менее некоторые интерпретаторы могут скушать и последний вариант). | |
Meaning of slash character | ||
The slash character (/), depending on its position, is used in different meanings in a file URL. | Символ слэш (/) в зависимости от положения в URL-адресе файла имеет разный смысл. | |
* The // after the file: is part of the general syntax of URLs. (The double slash // should always appear in a file URL according to the specification, but in practice many Web browsers allow you to omit it, in some cases at least.) | * // после file: — часть синтаксиса URL-адреса. (Согласно спецификации двойной слэш // должен всегда быть в URL-адресе файла, однако на практике многие браузеры разрешают его пропускать.) | |
* The single slash between host and path is part of the syntax of file URLs. | * Одиночный слэш / между host и path — часть синтаксиса URL-адреса файла. | |
* And the slashes in path separate directory names in a hierarchical system of directories and subdirectories. In this usage, the slash is a general, system-independent way of separating the parts, and in a particular host system it might be used as such in a pathname (as in Unix systems). | * Слэши в path разделяют имена каталогов в иерархической системе каталогов и подкаталогов. В таком употреблении слэш — общий, независимый от системы способ разделения на части. На отдельной взятой операционной системе хоста слэш / может иметь тот же смысл в пути к файлу (как в системах Unix в pathname). | |
Examples | ||
Linux | ||
Here are two Linux examples pointing to the same /etc/fstab file: | Два примера URL-адреса на файл /etc/fstab в системе Linux: | |
file://localhost/etc/fstab | ||
file:///etc/fstab | ||
Windows | ||
Here are some examples which may be accepted by some applications on Windows systems, referring to the same, local file c:\WINDOWS\clock.avi | Примеры URL-адреса на файл c:\WINDOWS\clock.avi в системе Windows: | |
file://localhost/c|/WINDOWS/clock.avi | ||
file:///c|/WINDOWS/clock.avi | ||
file://localhost/c:/WINDOWS/clock.avi | ||
Here is the correct URI as understood by the Windows Shell API: | ||
file:///c:/WINDOWS/clock.avi | ||
For a local file, the last is the most obvious and human-readable, and also the canonical one understood by the operating system. | Для локального файла последний пример наиболее очевидный и лёгкий для восприятия. Его каноническая форма понятна и для операционной системы. | |
Things to consider | ||
Windows | ||
On MS Windows systems, the normal colon (:) after a device letter has sometimes been replaced by a vertical bar (|) in file URLs. This reflected the original URL syntax, which made the colon a reserved character in a path part. | В Windows обыкновенное двоеточие (:) в URL-адресе файла после буквы устройства иногда заменено вертикальной чертой (|). Таким образом воспроизведён первоначальный URL-синтаксис, который сделал двоеточие зарезервированным символом в части path. |
