[net.micro.pc] Silly question

liz@unirot.UUCP (06/26/86)

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 . ?

thanks
liz

-- 

liz sommers	
everywhere!topaz!caip!unirot!liz	caip!soup!liz	sommers.rutgers.edu
Somebody said "Whose life is this?" and I said "Well, it can't be mine."

brown@nicmad.UUCP (06/27/86)

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 . ?

It is understood that the root directory is the next cluster after the FAT.
Ok, I know!  How do you know which sector starts the FAT and which sector
starts the directory area?

A recent issue of PC Tech Journal had a very nice discussion on how to find
the various values that DOS uses to determine such goodies.  I suggest getting
a copy and reading through it.  You will find it very helpful.
-- 

              ihnp4------\
            harvard-\     \
Mr. Video      seismo!uwvax!nicmad!brown
              topaz-/     /
             decvax------/

sandersr@ecn-pc.UUCP (Robert C Sanders) (06/27/86)

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 drive name.  Whenever you want to
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
'.'.
					- bob
-- 
------------
Continuing Engineering Education Telecommunications
Purdue University

"Time is a mouse that requires constant feeding..." -- me

	...!ihnp4!pur-ee!pc-ecn!sandersr

matt@ucla-cs.ARPA (Matthew J Weinstein) (07/01/86)

liz@unirot.UUCP asked about getting to directories in DOS.  There is a set
of routines that emulates the 4.2BSD directory library routines.  These
were written from the interface description, and there are some fields that may
not correspond exactly (inode number, anyone?).  These routines compile with MS
C 3.0, and were tested under DOS 2.11, and less thoroughly under 3.1.
No guarantees about 3.2... (the hacking involved emulating seekdir()
using DOS's FCBs).

The directory routines attempt to make sense out of pathnames like `/.'
and `/..' and combinations thereof (`/.././..'), by mapping them to
root.  May not be right for networks (? is there a hyper-root on some
of the PC networks)..  I think simple drive syntax is recognized too..
(I hope I did that).

I wrote these routines because I detest the DOS interface, and prefer
something portable.

The routines are stored at ISIB in the <INFO-IBMPC> directory.  If there is 
any interest in a net posting, EMail directly ... don't post requests 
(even if your mailer bounces the message, you are probably well represented).

As always, improvements and bugfixes are welcome.

				- Matt
				{backbone}!ucla-cs!matt

davidsen@steinmetz.UUCP (07/16/86)

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"