Re: Opening a file - File Open Dialog spoils future code
- Posted by CChris <christian.cuvier at agri?ulture.g?uv.fr> Jan 16, 2008
- 556 views
Matt Lewis wrote: > > CChris wrote: > > > > open() doesn't understand Windows folders, because Windows doesn't have a > > notion > > of a current directory. open() uses the PATH environment variable, which is > > a DOS/Unix thing Windows supports for backward compatibility only) and looks > > for MyFileName.CFG in places completely different from where Windows looks > > for > > them, so it probably just can't see the file there. > > I thought that it did, and that %PATH is only used for executables and for > dlls. What do current_dir() and chdir() do then? > > Matt They do return something which is defined in the C library used to compile the source, so the answer lies in a black box. Does anyone know what they do under Windows? At any rate, I have learnt not to use open() with unqualified file names. As far as I remember from the discussion about where to put euinc.conf, it was decided not to rely on the current directory precisely for that reason. CChris