1. What is a file?
We call a complete meaningful part of data stored on a disk or optical disk a file. The meaning of data is broad. The programs we write, the software we copy, the images we create, etc., can all be called data, and data is stored on the disk in the form of files. For files, we can perform various operations such as creating, modifying, deleting, copying, and moving.
With files, it is natural to manage them, and naming the files is the best way. Each file has a name, called the file name, which consists of letters, numbers, or characters, such as COMMAND.COM. The file name can be divided into the main file name and the extended file name. Take COMMAND.COM as an example. COMMAND is the main file name, which mainly describes the content of the file. COM is the extended file name, which mainly describes the nature of the file (here COM Represents the command file), the decimal point in the middle is the separator for the main file name and the extended file name. DOS stipulates that the main file name cannot exceed 8 characters and the extended file name cannot exceed 3 characters. Because the decimal point is used exclusively as a separator, it cannot be used in main and extended file names. Additionally, spaces are not allowed in file names. The extension file name can be omitted, but the main file name must be present. Therefore, the following file names are wrong, such as .EXE (no main file name), ABC.BCD.COM (the main file name contains a decimal point), ABC.DEFG (the extended file name exceeds 3 characters).
In DOS, three extensions are specified for executable files, namely EXE, COM and BAT. The so-called executable file is a file that can execute the program by directly typing the main file name under DOS. Except for EXE, COM and BAT, all other files cannot be directly executed under DOS and are called non-executable files.
File name under DOS environment
Under DOS, the file name adopts the 8+3 structure, that is: the longest 8-digit file name, separated by a decimal point, followed by the longest 3 Bit suffix name, such as: READ.ME, SETUP.EXE. Generally, Chinese characters are not allowed in file names and can only be composed of letters, numbers and some symbols. For example, READ.ME in Chinese means "read me", which prompts users to read the contents of this file before using the software to obtain more prompt information. More importantly, DOS requires the use of suffix names to distinguish various files.
The most common thing to encounter under DOS is executable files. There are two types of suffixes: *.exe and *.com (* here means any file name). They are composed of assembly language Or files compiled by other high-level languages ??and run directly under DOS. Sometimes, due to the many functions of the software and the small memory, it cannot be loaded into the memory at once and there may be ovl files with the same file name, such as ws.exe, ws.ovl. There is also a file that can be run directly, *.bat, which is a batch file. There are many commands or executable file names in it. It is mainly used to improve work efficiency. The most useful one is Autoexec.bat. This file will be Be automatically executed (automatically execute means Automatically execute in English). Another type of file that can be loaded but cannot be run directly is the system extension management file *.sys (sys means system). It mainly provides drivers for certain non-standard devices such as mouse, expanded memory, etc., such as mouse.sys ,himem.sys. For unified management, a config.sys text file is specially provided to automatically load these necessary device drivers at startup. Once these files are accidentally deleted or renamed, or are infected by viruses, they will directly cause the system to malfunction. Not normal.
The files generated by word processing under DOS do not need a suffix, but people often use *.txt to represent them (txt is text). Supported by all platforms and all applications.
For the convenience of management, people can also use their own names as suffixes to indicate that they are text files created by themselves. For example, many of the articles I entered are *.mcj, so that users can restore the original files as soon as possible if they accidentally delete them. Many word processing systems provide an automatic backup function for the original file. For example, when I edited JIHUA.MCJ for the second time (JIHUA: planned Chinese Pinyin), the system would first copy the original file to JIHUA.BAK. When using word processing software with special format functions, such as WPS launched by Mr. Qiu Bojun in his early years, the suffix will be .wps to identify text files generated by WPS. When using word processing software to edit high-level language programs, the suffix is ??usually the first three letters of the corresponding language (for example: *.BAS means BASIC language source program, *.PAS means PASCAL language program, *.FOR means Fortran language program, * .C is C language, *.ASM is assembly language program).
The following types of files are often attached to the executable file: *.HLP is the help file (help), *.CFG is the configuration file (config), *.DAT is the data file (data), *.LOG is a log file (log), and *.TMP is a temporary file (temporal).