M.-A. Lemburg: > By dropping the trailing slash from the path > you are removing important information from the path information. No, you're not. A trailing slash on a Unix pathname doesn't tell you anything about whether it refers to a directory. Actually, it doesn't tell you anything at all. Slashes simply delimit pathname components, nothing more. A demonstration of this: s454% cat > foo/ asdf s454% cat foo/ asdf s454% A few utilites display pathnames with trailing slashes in order to indicate that they refer to directories, but that's a special convention confined to those tools. It doesn't apply in general. The only sure way to find out whether a given pathname refers to a directory or not is to ask the filesystem. And if the object referred to doesn't exist, the question of whether it's a directory is meaningless. Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | A citizen of NewZealandCorp, a | Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. | greg@cosc.canterbury.ac.nz +--------------------------------------+
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4