/* * xchdir() changes your directory. OS2 and dos have library chdirs that * don't actually put you in the new directory if you're not on the filesystem. * This has problems :-( */ #include #if OS2 #include xchdir(path) char *path; { int drive; if (chdir(path) != 0) return -1; if (*path && path[1] == ':') { drive = (tolower(*path)-'a'); if (DosSelectDisk(1+drive) != 0) { errno = ENODEV; return -1; } } return 0; } /* xchdir */ #elif MSDOS #include xchdir(path) char *path; { unsigned drive; unsigned map; if (chdir(path) != 0) return -1; if (*path && path[1] == ':') { drive = (tolower(*path)-'a'); _dos_setdrive(1+drive, &map); } return 0; } /* xchdir */ #elif GEMDOS #include xchdir(path) char *path; { } /* xchdir */ #endif