What is the naming standard for path components?

后端 未结 8 1551
广开言路
广开言路 2020-12-22 15:22

I keep getting myself in knots when I am manipulating paths and file names because I don’t follow a naming standard for path components.

Consider the following toy pr

8条回答
  •  旧巷少年郎
    2020-12-22 16:14

    Simple answer you could adopt for simple projects:

    | name  | example          |
    |-------|------------------|
    | path  | /foo/bar/baa.txt |
    | dir   | /foo/bar/        |
    | file  | baa.txt          |
    | stem  | baa              |
    | ext   | .txt             |
    | parent| /foo/bar/        | (useful for parent dirs)
    

提交回复
热议问题