Path: utzoo!utgpu!jarvis.csri.toronto.edu!helios.physics.utoronto.ca!ists!yunexus!geac!maccs!cs4g6ag From: cs4g6ag@maccs.dcss.mcmaster.ca (Stephen M. Dunn) Newsgroups: comp.sys.ibm.pc.programmer Subject: Re: Sticky Problems with C on IBM-compatibles Keywords: text, printer, display, directory, screen Message-ID: <25E99340.10868@maccs.dcss.mcmaster.ca> Date: 26 Feb 90 20:36:16 GMT References: <492@bilver.UUCP> <4467@pegasus.ATT.COM> Reply-To: cs4g6ag@maccs.dcss.mcmaster.ca (Stephen M. Dunn) Organization: McMaster University, Hamilton, Ontario Lines: 25 In article <4467@pegasus.ATT.COM> psrc@pegasus.ATT.COM (Paul S. R. Chisholm) writes: $> 7) If my PATH environment variable is set up so that I can run one of my $> programs from a directory different than the one containing my program, $> how it possible for my program to determine the directory IT started $> from? Or does that information have to be hard-coded in my program? $DOS 3.0 and later generate enough information for the TC start-up code $to put the path name in argv[0]. In version 1.x and 2.x, your best bet $is to (yuchh) search the current directory, and then the path, $yourself. Well, that really only applies to DOS 2 and above ... DOS 1 doesn't have subdirectories, and I don't recall it having had an environment, either, though I could be wrong. Anyway, I don't think any current C compilers have libraries that will work under DOS 1 anyway. BTW, in regard to the second edition of Duncan's book (_Advanced MS-DOS_): how significant are the differences between it and the first edition? I believe the second one covers DOS 3.3 (and 4?) and EMS 4.0 ... any other major diffs? Is it worth buying a copy of the new edition? -- Stephen M. Dunn cs4g6ag@maccs.dcss.mcmaster.ca = "\nI'm only an undergraduate!!!\n"; **************************************************************************** I Think I'm Going Bald - Caress of Steel, Rush