rockbox/uisimulator/x11/io.c
Daniel Stenberg 91f165e3da support open() properly so that the root dir works in the archos subdir
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@425 a1c6a512-1295-4272-9138-f99709370657
2002-05-05 10:28:23 +00:00

28 lines
558 B
C

#include <dirent.h>
#define SIMULATOR_ARCHOS_ROOT "archos"
DIR *x11_opendir(char *name)
{
char buffer[256]; /* sufficiently big */
if(name[0] == '/') {
sprintf(buffer, "%s/%s", SIMULATOR_ARCHOS_ROOT, name);
return opendir(buffer);
}
return opendir(name);
}
int x11_open(char *name, int opts)
{
char buffer[256]; /* sufficiently big */
if(name[0] == '/') {
sprintf(buffer, "%s/%s", SIMULATOR_ARCHOS_ROOT, name);
Logf("We open the real file '%s'", buffer);
return open(buffer, opts);
}
return open(name, opts);
}