getcwd() for different OS - how to detect directory delim?
Posted: Wed Feb 07, 2007 2:07 am
hi all
im using getcwd to return the current working directory (ie: d:\code\moo) on my windows evironment. i assign this value to a string. i then want to concatenate a sub-directory to teh string, ie: getcwd() . "\foo"
this works fine and all, but if its in a unix environment, the getcwd() would return /code/moo, and i'd be appending "\foo" instead of "/foo".
how do i solve this?
im using getcwd to return the current working directory (ie: d:\code\moo) on my windows evironment. i assign this value to a string. i then want to concatenate a sub-directory to teh string, ie: getcwd() . "\foo"
this works fine and all, but if its in a unix environment, the getcwd() would return /code/moo, and i'd be appending "\foo" instead of "/foo".
how do i solve this?