jac@paul.rutgers.edu (Jonathan A. Chandross) (02/11/91)
Submitted-by: NONE Posting-number: Volume 1, Source:25 Archive-name: util/pwd.c Architecture: ANY_2 Version-number: 1.00 Print the working directory of AZTEC C on the APPLE stdout device. It should be easy, but since there is no system call to do it, we open an absurdly named file for read and then go peeking around in DOS to see what drive the system tried to read it on. =pwd.c - -/* - * - * pwd.c - * - * Print the working directory of AZTEC C on the APPLE - * stdout device. It should be easy, but since there is no - * system call to do it, we open an absurdly named file for - * read and then go peeking around in DOS to see what drive - * the system tried to read it on. - * - * Usage: - * pwd - * - * John Duncan - * November 1983 - * Version 1.00 - */ - -#define DRIVE 0xB7F8 -#define SLOT 0xB7F7 -#define VOL 0xB7F6 - -char mesg[] = "sX, dX, vXXX\n"; -main() -{ - register char ch; - - open( "", 0 ); - ch = *SLOT; - mesg[1] = (ch>>4) + '0'; - ch = *DRIVE; - mesg[5] = ch + '0'; - ch = *VOL; - mesg[11] = ch%10 + '0'; - ch = ch/10; - mesg[10] = ch%10 + '0'; - mesg[9] = ch/10 + '0'; - write( 1, mesg, 13 ); -} - - + END OF ARCHIVE