Article View: comp.unix.msdos
Article #565SUMMARY: UNIX-style links under MS-DOS
From: Pete Gontier
Date: Wed, 27 Jan 1993 19:41
Date: Wed, 27 Jan 1993 19:41
58 lines
3069 bytes
3069 bytes
I don't remember if I promised a summary, but I got such high-quality repsonses that I figured I owed one. My problem was this: due to #include file directory search limitations of typical DOS C compilers (Borland, Microsoft), our highly hierarchical source structure was giving us fits. We were trying to specify too many directories for the compiler to search; the command line was full and the relevant environment variable(s) was (were) full. I was hoping that someone had hacked DOS to support UNIX-style links. I could then create a directory and fill it with links to files deeply nested in our hierarchy. I could then instruct the compiler to look in only that one place for #include files. It turns out that this is: 1) not necessary, 2) not possible. :-) DOS apparently maintains in its directory a direct reference to a file's location on disk. (UNIX uses an indirect reference.) If one were to create a "link" under DOS, it would point to the right place on the disk only until the file were modified. DOS would dutifully update the file's "real" directory entry, and the link would get stale. The DOS tool CHKDSK would eventually complain and try to "fix" the link. Another possibility I imagined might work would be to patch DOS with a TSR (terminate-and-stay-resident program). Several people wrote to tell me this would be compatibility hell, in terms of both other hacks and Windows, which doesn't necessarily go through official DOS file system channels when it wants to mess with the file system. A good suggestion, put foward by several people, was to use the DOS SUBST or JOIN command in whatever way was appropriate. Apparently SUBST lets you assign a drive letter to an arbitrary directory, which means I could "alias" C:\FOO\BAR\BAZ\QUUX to Q:. Specifying Q: to the compiler would be a lot shorter than the pathname. Apparently JOIN is similar to UNIX mount. Another good suggestion, put forward by several more people, was to create dummy header files in one directory. A file called "QUUX.H" might contain #include "\FOO\BAR\BAZ\QUUX.H" Several schemes were mentioned which allowed one to at least partially automate the creation of these dummy header files, inlcuding using the DIR /S command in various ways. Thanks to all who responded. P.S. Some people 1) suggested that the next version of DR DOS might support links. 2) told me that they were working on a relatively safe method for creating links under DOS. Keep your eyes and ears open for both. -- Pete Gontier // EC Technology // gurgle@netcom.com
Technical Details
Message-ID:
<1993Jan27.194149.26386@netcom.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!amdahl!rtech!pacbell.com!decwrl!csus.edu!netcom.com!gurgleShow Full Headers
Complete Article Headers
Newsgroups: comp.unix.msdos,comp.unix.questions,alt.msdos.programmer,comp.os.msdos.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!amdahl!rtech!pacbell.com!decwrl!csus.edu!netcom.com!gurgle From: gurgle@netcom.com (Pete Gontier) Subject: SUMMARY: UNIX-style links under MS-DOS Message-ID: <1993Jan27.194149.26386@netcom.com> Followup-To: poster Keywords: link DOS unix Organization: cellular Date: Wed, 27 Jan 1993 19:41:49 GMT Lines: 58