Each path element contains a single dirname element, so the code searches for elements named dirname and grabs the first entry.
每个path元素包含了一个dirname元素,所以代码搜索名称为dirname的元素,并获取其中的第一个条目。
While basename and dirname are great tools, there are times where we may need to perform more advanced string "chopping" operations than just standard pathname manipulations.
尽管basename和dirname是很好的工具,但有时可能需要执行更高级的字符串“截断”,而不只是标准的路径名操作。
The dirname of the script being executed.
当前正在执行脚本所在的目录名。
The dirname function returns the directory name from a path.
函数的作用是:返回路径中的目录名称。
The dirname function returns the directory name from a path.
函数的作用是:返回路径中的目录名称。
应用推荐