🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sources.apple2
Article #92

v001SRC025: pwd For DOS 3.3

#92
From: Jonathan A. Chandross
Date: Mon, 11 Feb 1991 02:03
57 lines
1755 bytes
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
Technical Details
Message-ID: <Feb.10.21.03.45.1991.2006@paul.rutgers.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!tut.cis.ohio-state.edu!magnus.ircc.ohio-state.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!cs.utexas.edu!bcm!dimacs.rutgers.edu!aramis.rutgers.edu!paul.rutgers.edu!jac

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!tut.cis.ohio-state.edu!magnus.ircc.ohio-state.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!cs.utexas.edu!bcm!dimacs.rutgers.edu!aramis.rutgers.edu!paul.rutgers.edu!jac
From: jac@paul.rutgers.edu (Jonathan A. Chandross)
Newsgroups: comp.sources.apple2
Subject: v001SRC025:  pwd For DOS 3.3
Message-ID: <Feb.10.21.03.45.1991.2006@paul.rutgers.edu>
Date: 11 Feb 91 02:03:46 GMT
Organization: Rutgers Univ., New Brunswick, N.J.
Lines: 57
Approved: jac@paul.rutgers.edu