So you are saying, under Windows, the single dot always indicates the current working directory and not the executable directory, unless they happen to be the same (which is most of the time)?
It's always the current working directory, I believe.
Is it the same on Mac and Linux?
I don't currently have access to a Mac and I don't have Linux installed, so I can't currently try it out.
You could always whip up a quick program to find out, though!
Thank you, that helps.
Anything that does not explicitly specify a drive is relative to the working directory, so the period has no real meaning on Windows. The working directory is often the same as the executable directory but could be different if the executable changes it at run-time, it is run under Visual Studio, or run from a .bat file located elsewhere (the working directory will be that of the .bat file).
And in the situation of running from a command-line prompt like this:
C:/> CD C:/path/to/folder/
'program.exe' will have the current working directory of 'C:/path/to/folder/ ', and not 'C:/path/different/folder/ ' ?
So is the 'current directory' the "directory of the executable", or "the current working directory of the environment"?
Mac OS X is Unix based, thus it inherits most of its features, including the paths.
In Unix- based OS, such as Linux,
. = current directory
.. = parent directory
Thanks, I was wondering about that. So folder/file and ./folder/file would be the same directory?
Anything else [speaking of Unix-like systems] is considered relative paths (so folder/file and ./folder/file and ../myfolder/folder/file are all relative paths).
[Edit:] Fixed broken quotes a day later.