It's always the current working directory, I believe.
So you are saying, under Windows
, the single dot always
indicates the current working directory
the executable directory, unless they happen to be the same (which is most of the time)?
Is it the same on Mac and Linux?
You could always whip up a quick program to find out, though!
I don't currently have access to a Mac and I don't have Linux installed, so I can't currently try it out.
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).
Thank you, that helps.
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/ '
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
So is the 'current directory' the "directory of the executable", or "the current working directory of the environment"?
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).
Thanks, I was wondering about that. So folder/file
would be the same directory?
Fixed broken quotes a day later.
Edited by Servant of the Lord, 24 January 2013 - 11:53 AM.