Should a directory path variable end with a trailing slash?

前端 未结 12 2060
暖寄归人
暖寄归人 2020-12-24 04:33

When defining a path to a directory as a variable or constant, should it end with a trailing slash? What is the convention?

pwd in Unix shows your curre

12条回答
  •  情书的邮戳
    2020-12-24 04:43

    Yes, there are lots of filesystems that support files without any extensions, so always add the trailing slash to avoid any problems.

提交回复
热议问题