Should a directory path variable end with a trailing slash?

前端 未结 12 2024
暖寄归人
暖寄归人 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 05:00

    I tend to just add the trailing slash as I am more than likely going to use that directory to add/retrieve files...

    In terms of web referencing, it can actually increase performance leaving the trailing slash in

    http://www.netmechanic.com/news/vol4/load_no11.htm

提交回复
热议问题