Home > Backend Development > C++ > How Can I Ensure My Application Creates Legally Compliant Windows File Names?

How Can I Ensure My Application Creates Legally Compliant Windows File Names?

Barbara Streisand
Release: 2025-01-24 16:38:10
Original
110 people have browsed it

"How

Create an application that complies with the naming specifications of the Windows file

Integrated file renames in the application need to verify whether the target file name specified by the user is in line with the Windows naming agreement. Although simple regular expressions are sufficient to verify, they ignore characters in specific languages, such as sound -changing symbols.

According to Microsoft's documents, the legal Windows file name follows the following general rules:

Forbidden characters:

,

,
    ,
  • , ,, ", :, / | The characters of the integer value intercity between 0-31 (ASCII space and below) ? * The character that does not support the file system (e.g., the ending of the end or the space)
  • DOS name (CON, PRN, AUX, etc.)
  • The file name consisting of only a period
  • In addition, please consider the following optional check:
For the path that does not use prefix, the maximum path length is 260 characters

For the UNICODE path that uses prefix, the maximum length is 32,000 characters (note the potential overflow problem)

The above is the detailed content of How Can I Ensure My Application Creates Legally Compliant Windows File Names?. For more information, please follow other related articles on the PHP Chinese website!

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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template