mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-02-03 23:40:14 +08:00
translated
This commit is contained in:
parent
de365707ed
commit
f1c4323003
@ -1,117 +0,0 @@
|
||||
[#]: subject: (Understanding file names and directories in FreeDOS)
|
||||
[#]: via: (https://opensource.com/article/21/3/files-freedos)
|
||||
[#]: author: (Kevin O'Brien https://opensource.com/users/ahuka)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
Understanding file names and directories in FreeDOS
|
||||
======
|
||||
Learn how to create, edit, and name files in FreeDOS.
|
||||
![Files in a folder][1]
|
||||
|
||||
The open source operating system [FreeDOS][2] is a tried-and-true project that helps users play retro games, update firmware, run outdated but beloved applications, and study operating system design. FreeDOS offers insights into the history of personal computing (because it implements the de facto operating system of the early '80s) but in a modern context. In this article, I'll use FreeDOS to explain how file names and extensions developed.
|
||||
|
||||
### Understanding file names and ASCII text
|
||||
|
||||
FreeDOS file names follow what is called the _8.3 convention_. This means that all FreeDOS file names have two parts that contain up to eight and three characters, respectively. The first part is often referred to as the _file name_ (which can be a little confusing because the combination of the file name and the file extension is also called a file name). This part can have anywhere from one to eight characters in it. This is followed by the _extension_, which can have from zero to three characters. These two parts are separated by a dot.
|
||||
|
||||
File names can use any letter of the alphabet or any numeral. Many of the other characters found on a keyboard are also allowed, but not all of them. That's because many of these other characters have been assigned a special use in FreeDOS. Some of the characters that can appear in a FreeDOS file name are:
|
||||
|
||||
|
||||
```
|
||||
`~ ! @ # $ % ^ & ( ) _ - { } ``
|
||||
```
|
||||
|
||||
There are also characters in the extended [ASCII][3] set that can be used, such as <20>.
|
||||
|
||||
Characters with a special meaning in FreeDOS that, therefore, cannot be used in file names include:
|
||||
|
||||
|
||||
```
|
||||
`*/ + | \ = ? [ ] ; : " . < > ,`
|
||||
```
|
||||
|
||||
Also, you cannot use a space in a FreeDOS file name. The FreeDOS console [uses spaces to separate commands][4] from options and parameters.
|
||||
|
||||
FreeDOS is case _insensitive_, so it doesn't matter whether you use uppercase or lowercase letters. All letters are converted to uppercase, so your files end up with uppercase letters in the name, no matter what you do.
|
||||
|
||||
#### File extensions
|
||||
|
||||
A file in FreeDOS isn't required to have an extension, but file extensions do have some uses. Certain file extensions have built-in meanings in FreeDOS, such as:
|
||||
|
||||
* **EXE**: executable file
|
||||
* **COM**: command file
|
||||
* **SYS**: system file
|
||||
* **BAT**: batch file
|
||||
|
||||
|
||||
|
||||
Specific software programs use other extensions, or you can use them when you create a file. These extensions have no absolute file associations, so if you use a FreeDOS word processor, it doesn't matter what extension you use for your files. You could get creative and use extensions as part of your filing system if you want. For instance, you could name your memos using *.JAN, *.FEB, *.MAR, *.APR, and so on.
|
||||
|
||||
### Editing files
|
||||
|
||||
FreeDOS comes with the Edit application for quick and easy text editing. It's a simple editor with a menu bar along the top of the screen for easy access to all the usual functions (such as copy, paste, save, and so on.)
|
||||
|
||||
![Editing in FreeDOS][5]
|
||||
|
||||
(Kevin O'Brien, [CC BY-SA 4.0][6])
|
||||
|
||||
As you might expect, many other text editors are available, including the tiny but versatile [e3 editor][7]. You can find a good variety of [FreeDOS applications][8] on GitLab.
|
||||
|
||||
### Creating files
|
||||
|
||||
You can create empty files in FreeDOS using the `touch` command. This simple utility updates a file's modification time or creates a new file:
|
||||
|
||||
|
||||
```
|
||||
C:\>touch foo.txt
|
||||
C:\>dir
|
||||
FOO TXT 0 01-12-2021 10:00a
|
||||
```
|
||||
|
||||
You can also create a file directly from the FreeDOS console without using the Edit text editor. First, use the `copy` command to copy input in the console (`con` for short) into a new file object. Terminate input with **Ctrl**+**Z** followed by the **Return** or **Enter** key:
|
||||
|
||||
|
||||
```
|
||||
C:\>copy con test.txt
|
||||
con => test.txt
|
||||
This is a test file.
|
||||
^Z
|
||||
```
|
||||
|
||||
The **Ctrl**+**Z** character shows up in the console as `^Z`. It isn't copied to the file but serves as an End of File (EOF) delimiter. In other words, it tells FreeDOS when to stop copying. This is a neat trick for making quick notes or starting a simple document to work on later.
|
||||
|
||||
### Files and FreeDOS
|
||||
|
||||
FreeDOS is open source, free, and [easy to install][9]. Exploring how FreeDOS treats files can help you understand how computing has developed over the years, regardless of your usual operating system. Boot up FreeDOS and start exploring modern retro computing!
|
||||
|
||||
* * *
|
||||
|
||||
_Some of the information in this article was previously published in [DOS lesson 7: DOS filenames; ASCII][10] (CC BY-SA 4.0)._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/3/files-freedos
|
||||
|
||||
作者:[Kevin O'Brien][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/ahuka
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/files_documents_paper_folder.png?itok=eIJWac15 (Files in a folder)
|
||||
[2]: https://www.freedos.org/
|
||||
[3]: tmp.2sISc4Tp3G#ASCII
|
||||
[4]: https://opensource.com/article/21/2/set-your-path-freedos
|
||||
[5]: https://opensource.com/sites/default/files/uploads/freedos_2_files-edit.jpg (Editing in FreeDOS)
|
||||
[6]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[7]: https://opensource.com/article/20/12/e3-linux
|
||||
[8]: https://gitlab.com/FDOS/
|
||||
[9]: https://opensource.com/article/18/4/gentle-introduction-freedos
|
||||
[10]: https://www.ahuka.com/dos-lessons-for-self-study-purposes/dos-lesson-7-dos-filenames-ascii/
|
@ -0,0 +1,118 @@
|
||||
[#]: subject: (Understanding file names and directories in FreeDOS)
|
||||
[#]: via: (https://opensource.com/article/21/3/files-freedos)
|
||||
[#]: author: (Kevin O'Brien https://opensource.com/users/ahuka)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
了解 FreeDOS 中的文件名和目录
|
||||
======
|
||||
了解如何在 FreeDOS 中创建,编辑和命名文件。
|
||||
![Files in a folder][1]
|
||||
|
||||
开源操作系统 [FreeDOS][2] 是一个久经考验的项目,可帮助用户玩复古游戏,更新固件,运行过时但受欢迎的应用以及研究操作系统设计。FreeDOS 提供了有关个人计算历史的见解(因为它实现了 80 年代初的事实上的操作系统),但是它是在现代环境中进行的。在本文中,我将使用 FreeDOS 来解释文件名和扩展名是如何发展的。
|
||||
|
||||
### 了解文件名和 ASCII 文本
|
||||
|
||||
FreeDOS 文件名遵循所谓的 _8.3 惯例_。这意味着所有的 FreeDOS 文件名都有两个部分,分别包含最多八个和三个字符。第一部分通常被称为_文件名_(这可能会让人有点困惑,因为文件名和文件扩展名的组合也被称为文件名)。这一部分可以有一个到八个字符。之后是_扩展名_,可以有零到三个字符。这两部分之间用一个点隔开。
|
||||
|
||||
文件名可以使用任何字母或数字。键盘上的许多其他字符也是允许的,但不是所有的字符。这是因为许多其他字符在 FreeDOS 中被指定了特殊用途。一些可以出现在 FreeDOS 文件名中的字符有:
|
||||
|
||||
|
||||
```
|
||||
`~ ! @ # $ % ^ & ( ) _ - { } ``
|
||||
```
|
||||
|
||||
扩展 [ASCII][3] 字符集中也有一些字符可以使用,例如 <20>。
|
||||
|
||||
在 FreeDOS 中具有特殊意义的字符,因此不能用于文件名中,包括:
|
||||
|
||||
|
||||
```
|
||||
`*/ + | \ = ? [ ] ; : " . < > ,`
|
||||
```
|
||||
|
||||
另外,你不能在 FreeDOS 文件名中使用空格。FreeDOS 控制台[使用空格将命令的与选项和参数分隔][4]。
|
||||
|
||||
FreeDOS 是_不区分大小写_的,所以不管你是使用大写字母还是小写字母都无所谓。所有的字母都会被转换为大写字母,所以无论你做什么,你的文件最终都会在名称中使用大写字母。
|
||||
|
||||
#### 文件扩展名
|
||||
|
||||
A file in FreeDOS isn't required to have an extension, but file extensions do have some uses. Certain file extensions have built-in meanings in FreeDOS, such as:
|
||||
FreeDOS 中的文件不需要有扩展名,但文件扩展名确实有一些用途。某些文件扩展名在 FreeDOS 中有内置的含义,例如:
|
||||
|
||||
* **EXE**:可执行文件
|
||||
* **COM**:命令文件
|
||||
* **SYS**:系统文件
|
||||
* **BAT**:批处理文件
|
||||
|
||||
|
||||
|
||||
特定的软件程序使用其他扩展名,或者你可以在创建文件时使用它们。这些扩展名没有绝对的文件关联,因此如果你使用 FreeDOS 的 word,你的文件使用什么扩展名并不重要。如果你愿意,你可以发挥创意,将扩展名作为你的文件系统的一部分。例如,你可以用 *.JAN、*.FEB、*.MAR、*.APR, 等等来命名你的备忘录。
|
||||
|
||||
### 编辑文件
|
||||
|
||||
FreeDOS 自带的 Edit 应用可以快速方便地进行文本编辑。它是一个简单的编辑器,沿屏幕顶部有一个菜单栏,可以方便地访问所有常用的功能(如复制、粘贴、保存等)。
|
||||
|
||||
![Editing in FreeDOS][5]
|
||||
|
||||
(Kevin O'Brien, [CC BY-SA 4.0][6])
|
||||
|
||||
正如你所期望的那样,还有很多其他的文本编辑器可以使用,包括小巧但用途广泛的 [e3 编辑器][7]。你可以在 GitLab 上找到各种各样的 [FreeDOS 应用][8] 。
|
||||
|
||||
### 创建文件
|
||||
|
||||
你可以在 FreeDOS 中使用 `touch` 命令创建空文件。这个简单的工具可以更新文件的修改时间或创建一个新文件。
|
||||
|
||||
|
||||
```
|
||||
C:\>touch foo.txt
|
||||
C:\>dir
|
||||
FOO TXT 0 01-12-2021 10:00a
|
||||
```
|
||||
|
||||
你也可以直接从 FreeDOS 控制台创建文件,而不需要使用 Edit 文本编辑器。首先,使用 `copy` 命令将控制台中的输入(简称 `con`)复制到一个新的文件对象中。用 **Ctrl**+**Z** 终止输入,然后按**回车**键:
|
||||
|
||||
|
||||
```
|
||||
C:\>copy con test.txt
|
||||
con => test.txt
|
||||
This is a test file.
|
||||
^Z
|
||||
```
|
||||
|
||||
**Ctrl**+**Z** 字符在控制台中显示为 `^Z`。它并没有被复制到文件中,而是作为文件结束(EOF)的分隔符。换句话说,它告诉 FreeDOS 何时停止复制。这是一个很好的技巧,可以用来做快速的笔记或开始一个简单的文档,以便以后工作。
|
||||
|
||||
### 文件和 FreeDOS
|
||||
|
||||
FreeDOS 是开源的、免费的且[易于安装][9]。探究 FreeDOS 如何处理文件,可以帮助你了解多年来计算的发展,不管你平时使用的是什么操作系统。启动 FreeDOS,开始探索现代复古计算吧!
|
||||
|
||||
* * *
|
||||
|
||||
_本文中的部分信息曾发表在 [DOS 课程 7:DOS 文件名;ASCII][10] 中(CC BY-SA 4.0)。_
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/3/files-freedos
|
||||
|
||||
作者:[Kevin O'Brien][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/ahuka
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/files_documents_paper_folder.png?itok=eIJWac15 (Files in a folder)
|
||||
[2]: https://www.freedos.org/
|
||||
[3]: tmp.2sISc4Tp3G#ASCII
|
||||
[4]: https://opensource.com/article/21/2/set-your-path-freedos
|
||||
[5]: https://opensource.com/sites/default/files/uploads/freedos_2_files-edit.jpg (Editing in FreeDOS)
|
||||
[6]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[7]: https://opensource.com/article/20/12/e3-linux
|
||||
[8]: https://gitlab.com/FDOS/
|
||||
[9]: https://opensource.com/article/18/4/gentle-introduction-freedos
|
||||
[10]: https://www.ahuka.com/dos-lessons-for-self-study-purposes/dos-lesson-7-dos-filenames-ascii/
|
Loading…
Reference in New Issue
Block a user