Welcome! Log In Create A New Profile

Advanced

SDL chdir

Posted by Kajos 
SDL chdir
May 01, 2010 03:44PM
Hey everybody,

I'm struggling with SDL finding the equavalent of this piece of code:

int curdirfd = open("./", O_RDONLY);
if (-1 == curdirfd) {
return false;
}
if (-1 == chdir(path.c_str())) {
return false;
}
fchdir(curdirfd);
close(curdirfd);

which results to these errors:
444: error: 'chdir' was not declared in this scope
447: error: 'fchdir' was not declared in this scope
448: error: 'close' was not declared in this scope

I tried fat.h's diropen but it won't find that either (possibly I'm following a very outdated tutorial).

Any help is appreciated.
Re: SDL chdir
May 01, 2010 04:34PM
Fixed, please close, thanks.
Re: SDL chdir
May 06, 2010 03:06AM
What was your solution...I was able to compile and use the fat.h example but some other users were not. Please post what you did to resolve the situation.
Sorry, only registered users may post in this forum.

Click here to login