What characters are forbidden in Windows and Linux directory names?

前端 未结 17 2940
北海茫月
北海茫月 2020-11-22 01:05

I know that / is illegal in Linux, and the following are illegal in Windows (I think) * . \" / \\ [

17条回答
  •  感动是毒
    2020-11-22 01:54

    I had the same need and was looking for recommendation or standard references and came across this thread. My current blacklist of characters that should be avoided in file and directory names are:

    $CharactersInvalidForFileName = {
        "pound" -> "#",
        "left angle bracket" -> "<",
        "dollar sign" -> "$",
        "plus sign" -> "+",
        "percent" -> "%",
        "right angle bracket" -> ">",
        "exclamation point" -> "!",
        "backtick" -> "`",
        "ampersand" -> "&",
        "asterisk" -> "*",
        "single quotes" -> "“",
        "pipe" -> "|",
        "left bracket" -> "{",
        "question mark" -> "?",
        "double quotes" -> "”",
        "equal sign" -> "=",
        "right bracket" -> "}",
        "forward slash" -> "/",
        "colon" -> ":",
        "back slash" -> "\\",
        "lank spaces" -> "b",
        "at sign" -> "@"
    };
    

提交回复
热议问题