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
Yes, it should, as:
Pathname + filename = fully qualified file location.
SO the slash between the last directory and the filename needs to be either at the end of the pathname or the start of the filename. Prefixing filenames with a / means you need to take this into account if you just want to open a file (i.e if you assume that an unqualified filename is in the current working directory).