After years of programming it's still some of the simple things that keep tripping me up.
Is there a commonly agreed definition of filename ?
Even the wikipedia article confuses the two interpretations.
It starts by defining it as 'a special kind of string used to uniquely identify a file stored on the file system of a computer'. That seems clear enough, and suggests that a filename is a fully qualified filename, specifying the complete path to the file.
However, it then goes on to:
- talk about basename and extension (so basename would contain an absolute path ?)
- says that the length of a filename in DOS is limited to 8.3
- says that a filename without a path part is assumed to be a file in the current working directory (so the filename does not uniquely identify a file)
So, simple questions:
- what is a correct definition of 'filename' (include references)
- how should I unambiguously name variables for:
- a path to a file (which can be absolute/full or relative)
- a path to a resource that can be a file/directory/socket