Home > Common Problem > Characters that cannot be included in file names

Characters that cannot be included in file names

(*-*)浩
Release: 2019-06-06 10:12:48
Original
88265 people have browsed it

The file name is to make it easier for people to distinguish different files in the computer, and to set a designated name for each file. It consists of the main name of the file and its extension.

Characters that cannot be included in file names

The DOS operating system stipulates that the file name consists of the file main name and the extension. The file main name consists of 1 to 8 characters, and the extension consists of 1 to 3 characters. It consists of characters, and the main name and extension are separated by a small dot, which is generally called the 8.3 rule. (Recommended learning: PHP video tutorial)

The format is as follows:

□□□□□□□□.□□□
Copy after login

For example: G9401.DBF, where G9401 is the main name, DBF is the extension. The characters that can be used in the file main name and extension are:

(1) English letters: A—z (upper and lower case equivalent)

(2) Numbers: 0—9

(3) Chinese characters

(4) Special symbols: $#&@ ()-[]^~, etc.

(5)Various control characters and the following characters cannot be used in file names:

< > / \ | : " * ?

Because these characters have been used for other purposes.

windows breaks through the restrictions of DOS on file naming rules and allows the use of long file names. The main reason is that The naming rules are as follows:

(1) The maximum length of the file name can be 255 characters.

(2) An extension can be used, and the extension is used to indicate the file type, or Use an extension with multiple separators. For example, win.ini.txt is a legal file name, but its file type is determined by the last extension.

(3) Spaces are allowed in file names, but not The following characters are allowed (English input method status): < > / \ | : " * ?

(4) The windows system displays different cases of letters in the file name, but when using It is not case sensitive.

The file name is an identifier of the existence of the file. The operating system controls and manages it based on the file name. Different operating systems have slightly different rules for file naming, that is, the format and length of the file name vary depending on the system. Different. For example: UNIX/LINUX system distinguishes the case of file names, while some systems do not distinguish, such as: MS-DOS and WINDOWS.

The file extension is used to distinguish the attributes of the file. In some cases For example, in UNIX/LINUX systems, there is no difference between the hello.c file and the helloc file to the system. It is the same if the extension .c is added or not, and the system does not know it. What kind of file is it? After the user adds .c, it is convenient for the user to understand that it is a C language source code file.

But in MS-DOS and WINDOWS systems, the file extension is perceived by the system. In WINDOWS , different file extensions have their associated programs to open them. These extensions, such as txt, are usually registered in the system when the software is installed. In the registry, HKEY-CLASSES -Relevant information can be seen under the ROOT root key.

If you change the file extension to an extension that is not recognized by the system, you will be prompted to select the program to open when opening. For example, change hello.txt to hello.123. At the same time, you can see that the icon has also changed and become unknown. However, for WORD files such as .doc format, because they are developed by MICROSOFT, they maintain good compatibility. The system does not only check when sensing extension, and also checks the internal format identifier of the file, so even if .doc is changed to other characters, in a system with WORD installed, the system can still associate it with WORD for opening.

More PHP related For technical articles, please visit the PHP Graphic Tutorial column to learn!

The above is the detailed content of Characters that cannot be included in file names. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template