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?
getcwd() for different OS - how to detect directory delim?
Moderator: General Moderators
-
konstandinos
- Forum Commoner
- Posts: 68
- Joined: Wed Oct 04, 2006 4:20 am
Code: Select all
getcwd() . DIRECTORY_SEPARATOR . "foo"