Home Common Problem Characters that cannot be included in file names

Characters that cannot be included in file names

Jun 06, 2019 am 10:12 AM
file name

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!

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP application: use current date as file name PHP application: use current date as file name Jun 20, 2023 am 09:33 AM

In PHP applications, we sometimes need to save or upload files using the current date as the file name. Although it is possible to enter the date manually, it is more convenient, faster and more accurate to use the current date as the file name. In PHP, we can use the date() function to get the current date. The usage method of this function is: date(format, timestamp); where format is the date format string, and timestamp is the timestamp representing the date and time. If this parameter is not passed, it will be used

Tips for dealing with garbled Chinese file names in PHP Tips for dealing with garbled Chinese file names in PHP Feb 27, 2024 pm 02:18 PM

Tips for dealing with garbled Chinese file names in PHP During the development process, we often encounter the problem of garbled Chinese file names, especially when processing files uploaded by users. In PHP, how to correctly handle garbled file names is a common and important problem. This article will introduce some techniques for dealing with garbled Chinese file names and provide specific code examples to help readers better deal with this challenge. Problem description: When users upload files, the Chinese file names sometimes appear to be garbled. This is because different operating systems and browsers

Java how to loop through a folder and get all file names Java how to loop through a folder and get all file names Mar 29, 2024 pm 01:24 PM

Java is a popular programming language with powerful file handling capabilities. In Java, traversing a folder and getting all file names is a common operation, which can help us quickly locate and process files in a specific directory. This article will introduce how to implement a method of traversing a folder and getting all file names in Java, and provide specific code examples. 1. Use the recursive method to traverse the folder. We can use the recursive method to traverse the folder. The recursive method is a way of calling itself, which can effectively traverse the folder.

How to batch modify file names How to batch modify file names Nov 09, 2023 am 10:05 AM

Methods for batch modifying file names include using the mv command, using the rename command, using the find command combined with the mv command, using the mmv command, etc. Detailed introduction: 1. Use the mv command. The mv command is a command used to move files or rename files in the Linux system. Through the mv command, you can move a file to another location and modify the file name at the same time; 2. Use rename command, the rename command is a powerful batch file renaming tool, which can match and replace file names through regular expressions, etc.

Steps to solve the problem that the file name is too long and cannot be deleted in Windows 10 Steps to solve the problem that the file name is too long and cannot be deleted in Windows 10 Mar 27, 2024 pm 04:41 PM

1. First find the file or folder that you need to delete. Because the file name is too long, the system will prompt when performing the deletion operation, [The file or directory cannot be deleted because the file name is too long]; as shown in the figure: 2 . At this time, use the shortcut key [Win+R] to open Run, enter [cmd], and open the command prompt after confirmation; as shown in the figure: 3. First switch to the disk where the file is located, mine is in D, enter [D:] , and then switch to the folder where the file is located. Mine is in [1], enter [cd1], and then enter [dir] to see all the files in the directory. In my directory, there is only one file that needs to be deleted. ;As shown in the figure: 4. Enter [del*.png] at this time, that is, all files with the suffix png in the directory will be

Use the path/filepath.Split function to split the path into directory and file name parts Use the path/filepath.Split function to split the path into directory and file name parts Jul 25, 2023 pm 05:57 PM

Use the path/filepath.Split function to split the path into two parts: directory and file name. When developing programs or processing files, it is often necessary to split the path into two parts: directory and file name. In Go language, you can use the Split function in the path/filepath package to achieve this function. This article will introduce the usage of the Split function and give code examples. The Split function is defined as follows: funcSplit(pathstring)(di

What should I do if the file name turns blue in win7 system? What should I do if the file name turns blue in win7 system? Jul 20, 2023 pm 11:57 PM

What should I do if the file name turns blue in win7 system? The win7 system is currently the most popular Windows system. It has a very long history of development and is deeply loved by users. However, the win7 system also has problems, big and small. When many friends use the win7 system, they will find that the file names on the computer turn blue, and other newly created folders will also turn blue. This is What is the situation and how to solve it? Below, the editor will bring you a method to restore the win7 system file name to blue. Recovery method of win7 system file name turning blue 1. First, right-click the disk with blue file name and open properties. 2. Find the option to compress this drive to save disk space in the properties window and remove it.

Win11 cannot find the file. Please make sure the file name is correct. How to solve it? Details Win11 cannot find the file. Please make sure the file name is correct. How to solve it? Details Feb 01, 2024 pm 04:09 PM

When we use win11 computers, we will directly search the file name to quickly find the information we want, etc. However, many users also find that when searching, the computer pops up a pop-up box asking to make sure the file name is correct. , so what should we do? Users can directly enter the HKEY_CURRENT_USER path under the run window to set it up. Let this site introduce to users in detail how to solve the problem when Win11 cannot find the file. Please make sure the file name is correct. Win11 cannot find the file. Please make sure the file name is correct. How to solve it? Detailed method one: 1. Press the Win+R shortcut keys simultaneously on the keyboard to open the run window. 3. Expand HKEY_CU in the registry editor