Windows and its father. Three

  
original site] [serialized tutorial
series] "Windows and its father" about DOS
Chapter 2 Section 1

Chapter 2 File System and Command System

The file system of the first section DOS

DOS
has a complete and rigorous file system. In fact, this is just a way for DOS
to provide management information to users, essentially to manage information. The first step is to figure out what information a file represents and then perform a purposeful operation on it. From the perspective of the file itself, each file has the following characteristics (propertIEs):

1. File Main Name: People must have their own name, and each file must have Your own name. Under DOS
, the file name can consist of characters up to 8 bytes (up to 8 half-width words or 4 full-width words), but the following characters are disabled: ?, *, 〈 ,〉,/,,| , :, ;, , , ., +, spaces. However, Windows has processed this rule, and the length of the file's main name has been expanded to 256 bytes, which has disabled the space. Why should I disable it? Because these characters in DOS
already have their specific meaning, this will be introduced later. One more thing to note: DOS
also names each commonly used external device. These names cannot be used as the main names of general files. The list is as follows:
Devices represented by device names The device name represents the device CON keyboard and display LPT1 These four are the "parallel interface" provided by DOS
, and the printer is often connected to LPT1, which is very similar to the PRN device


PRN Printer LPT2 COM1 These are the "serial interface" provided by DOS
. The mouse is often connected to COM1. The modem LPT3 COM2 LPT4 COM3 AUX is often used on COM2. It is rarely used, similar to COM1


COM4 NUL DOS
Reserved "Empty" Devices Table 2-1-1 Device Name Table


2. File Extension Name: Just Just like people wearing different work clothes to identify their identity, the file name is not enough, there must be an 'extension' of no more than 3 characters to indicate the purpose of the file (the length requirement in Windows is relaxed to The sum of the file name and the file name does not exceed 256 bytes). The file extension is an important basis for distinguishing file types. Some commonly used file extension lists are as follows:


Extension file type extension File type extension File type EXE Program file TXT Text file BAK Backup file COM command file These files are commonly used The editing system establishes the SYS system file BAT batch file WAV waveform sound


File
The above three files are created, used and deleted by the system
DOS< Br>
External command, you can directly execute MID MIDI file HTM(L) Web file AVI image file This file stores web page information DOC Word
Document* MP3 MP3 format
sound file ARJ ARJ Compressed Package *** WPS WPS Document These files
Store Sound Information ZIP ZIP Compressed Package CED CCED Document TMP Temporary File ** These files are compressed packages


Table 2-1-2 Commonly used Extension Table

*Document is a type of file, it is a variety of files edited by the user;

** Temporary file extension may also be T01, %A% ...;

***The zip is such a Files: Many files compressed by the compression software is stored in a file, this file is called archive. It is the source of information for recovering files before compression, so make sure it is intact.

Usually we refer to the file name and file extension as the file name (File Name), and write it in the form of "file name. file extension". For example, the file name of a file is MYFILE, file. The extension is EXT, then the file name of the file is MYFILE.EXT, we actually find the file it represents by the file name. The file name is the most important feature of the file, which is fully applicable under Windows.

3. File Attribute: Each file may have four attributes: Read Only, Hidden, System, and Archive. Read-only files cannot be arbitrarily rewritten or deleted; implicit files cannot be viewed arbitrarily; system files cannot be arbitrarily rewritten, deleted, and viewed; archive attributes are common to all files and have no restrictions. A file can have multiple attributes at the same time and does not conflict with each other.

4. File Size: File size is also a feature of the file? Yes. The size of the file is also recorded under DOS
. The size of the file just created is 0 bytes. Of course, the file size can also be modified, so the logical size of the file is not necessarily the same as the actual size. Some viruses hide their sin by reducing the file size. File size and file take up disk space and are also related. The disk space occupied by the file is related to the size of the cluster of the disk. If the minimum cluster size is xKB and the file size is yKB, the disk space occupied by the file is ([y÷x]+1)×xKB.

5. File Created Date & Time: Any file, once created, DOS
will automatically write the system date and time when it was created to the file. This will determine the time and date the file was created. So how does DOS
know the date and time of the system? The DOS
Control Basic Input Output System (BiOS) is read from a Complementary Metal Oxide Semiconductor (CMOS) and is also modifiable.

The file system is the core of DOS
and the basis for future chapters. It must be firmly grasped.



Chapter 2 File System and Command System

Section 2 DOS
Tree Shape Management Mode

There are more files and there is a management problem. It is best to have a book in a specific drawer like a book in a bookcase. DOS
has also prepared such a "logical drawer" for the file, but in DOS
, it is called a directory! On a formatted disk, there is a root directory (Root Directory), which is like a cabinet; in the root directory, there are many subdirectories (Sub Directory), which is equivalent to the drawer on the cabinet. The file can be stored under the directory, and the subdirectory is also a special file with its own file name, creation date and time, and a minimum cluster of minimum disks. So some people argue that the file also has a directory attribute, which I agree with.

Figure 2-2-1 DOS
tree directory management mode indicates

Thus, the file system under DOS
forms such a pattern : The root directory stores some files and subdirectories, and the subdirectories store some subdirectories of files below the level... This is like a tree in nature! No? The root directory is like a tree trunk, the subdirectories are like branches, and the branches are forked. The files are like leaves and grow on trunks and branches. Subdirectories under the root directory are called first-level subdirectories, subordinate subdirectories are called secondary subdirectories, and so on, but the number of levels is limited. So how can we find every file accurately? Not difficult. DOS
proposes the concept of a path. The expression of a file in DOS
follows the following rules:

1. First determine the drive letter (drive ). DOS
The drive letter assigned to the floppy disk is A and B. The drive letter assigned to the hard disk is a number of letters starting from C. The drive letter assigned to the CD and the network mapped disk is the last hard drive letter. after. It is the first step to figure out which disk is the code number in the disk.

2. Next, determine the directory where you are. Different levels of directories are separated by a "\\" sign, and the root directory is represented by a single "\\" sign. This may be a bit abstract, for example. For example, a file name is Eiyl7xb9.DAT file in the Java
subdirectory under the Windows subdirectory under the Data subdirectory under the Packages subdirectory (scarely), its path is "\\ Windows\\Java
\\Packages\\Data";

3. The exact location of the file should be written as "drive letter: path\\filename". If the above file exists on the C drive, "C:\\Windows\\Java
\\Packages\\Data\\ Eiyl7xb9.DAT" is the exact location of this file.

4. There are two sub-directories in each subdirectory: "." and "..", the former represents the current directory (Current Directory), which is the directory itself; the latter represents The location directory (Location Directory), also known as its parent directory (Parent Directory). For example: "C:\\Windows\\." and "C:\\Windows" are one thing, "C:\\Windows\\Java
\\.." and "C:\\Windows" are also the same thing. .

5. For the convenience of users, DOS
provides two wildcard characters "?" and "*". Use them to specify a batch of files at once. "?" represents a half-width un-disabled character or space, and "*" represents any number of un-disabled characters or spaces. "?" and "*" can be used both in the file's main name and in the file extension, but not in the path. For example, All the Files can be matched with "*.*"; all files starting with M can be matched with "M*.*"; all Word
documents can have "* .DOC" to match; A1.TXT, A3.TXT, A10.TXT, A100.TXT, A100.EXE and ABC.WAV of the 6 files, the first 2, 3, 4, 5, 6 can be used separately A?.TXT, A??.TXT, A???.TXT, A???.?X? and A*.* match; all MIDI files starting with GB in the upper directory of the current directory of the C drive can be used. "C:..\\GB*.MID" to match. And "C:\\Windows\\Ja??\\Pack*\\E*.*" is illegal. If a general user wants to use a batch of files, they will definitely have some common points in the file name.

Copyright © Windows knowledge All Rights Reserved