Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utcs!mnetor!seismo!columbia!caip!princeton!allegra!ulysses!bellcore!decvax!mcnc!ncsu!uvacs!edison!steinmetz!davidsen From: davidsen@steinmetz.UUCP Newsgroups: net.micro.pc Subject: Re: Silly question (accessing /) Message-ID: <835@steinmetz.UUCP> Date: Tue, 15-Jul-86 22:16:14 EDT Article-I.D.: steinmet.835 Posted: Tue Jul 15 22:16:14 1986 Date-Received: Wed, 16-Jul-86 22:33:04 EDT References: <789@unirot.UUCP> <530@ecn-pc.UUCP> Reply-To: davidsen@kbsvax.UUCP (Davidsen) Organization: GE CRD, Schenectady, NY Lines: 41 In article <530@ecn-pc.UUCP> sandersr@ecn-pc.UUCP (Robert C Sanders) writes: >In article <789@unirot.UUCP> liz@unirot.UUCP (Mamaliz ) writes: >>All of a sudden I am terribly confused. The DOS technical reference tells >>me that \ is not a file. How do I find out what files are under it then? >>Where do I find it? I do not hack assembler and would really like to do >>what I am doing in C. So, how do people deal with the fact that root has >>no . ? > > Think of it this way: D:\ and D: are considered synomous for backwards >compatibility -- where 'D' refers to a dr>check for '.', first call the DOS interupt 21H (most C libraries allow this) >for the function that returns the current drive/path description as a string, >and then strcmp() it to some "D:\". If true (0), you now know the name of >'.'. Not true!! The string "D:" refers to "the current directory on drive D:", while the string "D:\" refers to "the root directory on drive D:". They are not, were not, and will not be the same! Since many people don't believe me, assume that there is a directory "foo" on drive D:, and the current drive is C:. Stuff after "#" is comments: C>cd d:\ # current directory on D: is root C>dir D: # list root dir on D: C>cd d:\foo # current directory on D: is \foo C>dir D: # list \foo directory on D: C:dir D:\ # list root directory on D: I assume you understand and merely mistyped, but please don't confuse the innocent on this. A drive name used without an *explicit* directory refers to the current directory on that drive, which may very well not be the root. This is useful when you do it on purpose... -- -bill davidsen ihnp4!seismo!rochester!steinmetz!--\ \ unirot ------------->---> crdos1!davidsen chinet ------/ sixhub ---------------------/ (davidsen@ge-crd.ARPA) "Stupidity, like virtue, is its own reward"