":"-windows 文件系统中的字符(以前:":"-Delphi TFileStream 中的字符)

":"-Character in a windows filesystem (formerly: ":"-Character in Delphi TFileStream)

我试图在文件流的文件名字符串中放置一个冒号。 Delphi 中的 TFileStream 中真的不能使用冒号吗? 如果可以,那么怎么做?

编辑: 感谢所有反对票。这是应得的。回想起来我问了一个愚蠢的问题...

在 Windows 上,我认为这是您的平台,冒号是保留字符,因此不允许出现在文件名中。这记录在这里:

File and Directory Names

Naming Conventions
The following fundamental rules enable applications to create and process valid names for files and directories, regardless of the file system:

...

  • Use any character in the current code page for a name, including Unicode characters and characters in the extended character set (128–255), except for the following:

    • The following reserved characters:

      • < (less than)
      • > (greater than)
      • : (colon)
      • " (double quote)
      • / (forward slash)
      • \ (backslash)
      • | (vertical bar or pipe)
      • ? (question mark)
      • * (asterisk)

...