[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

side note to ppfChdir




Having to do a real chdir() is a bad idea IMHO. The problem is that it
changes the general behavior of the program, for example, if it core
dumps, the dump will not be in the expected place. Example:

$ ./sometest
Segmentation Fault (core dumped)
$ file core
core: can't stat `core' (No such file or directory).

"Huh? Oh..."

$ file /some/data/dir/that/only/the/expert/will/know/about/core
/some/data/dir/that/only/the/expert/will/know/about/core: ELF 32-bit LSB
core file of 'sometest' (signal 11), Intel 80386, version 1

-- 
Pierre Phaneuf
Ludus Design, http://ludusdesign.com/
"First they ignore you. Then they laugh at you.
Then they fight you. Then you win." -- Gandhi