05-11-2010 12:42 PM
I'm a little confused as to what this means. It seems like there is a contradiction here. I'm just not clear on exactly what you do with working directory.
working directory is the file system directory from which you want to execute the command. You do not have to set working directory. Note Do not use working directory to locate the executable you want to run. working directory applies to the executable only after it launches
05-11-2010 01:16 PM - edited 05-11-2010 01:17 PM
An executable has something called "current directory". It is by default set to the directory in which the executable resides but can be set to any other valid file system location. This directory is used by some file system operations if they get passed a relative file path (doesn't start with double backslash or <drive letter>: ) . They then take the relative file path and append it to the current directory to build an absolute path to refer to the actual file.
You can think of it as the directory that is for instance shown in the command prompt when you open a DOS Window. You still can enter absolute file paths outside of that directory, but whenever you enter a relative file path it is treated to be in relation to that current directory location that the command prompt shows.
For many GUI applications the current (working) directory has not much of a meaning (but for instance if it displays a file dialog and doesn't set the start path explicitedly, that file dialog will always open in the current directory). However for command line executables this working directory can be very important when relative file paths are used somewhere.