What characters are forbidden in Windows and Linux directory names?

前端 未结 17 2584
北海茫月
北海茫月 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:49

    Well, if only for research purposes, then your best bet is to look at this Wikipedia entry on Filenames.

    If you want to write a portable function to validate user input and create filenames based on that, the short answer is don't. Take a look at a portable module like Perl's File::Spec to have a glimpse to all the hops needed to accomplish such a "simple" task.

提交回复
热议问题