[comp.sys.ibm.pc.programmer] can you tell if a logical drive is a ramdisk

alawlor@dit.ie (Aengus Lawlor) (04/06/90)

In article <1990Mar31.034515.7622@rducky.uucp>, jrp@rducky.uucp (JIM PICKERING) writes:
> I am writing an application that needs to determine is a logical drive
> (E for example) is a ramdisk.  Is there any way?  Perhaps there is some
> information in the BPD obtained through an ioctl() call?
Can you get the date associated with the label on the drive?
If it's todays date, it's probably a ram drive.

(Not perfect, but reasonably do-able)
-- 
Aengus Lawlor    Dept of Computer Science.           Time flies like an arrow,
ALAWLOR@DIT.IE   Dublin Institute of Technology.     Fruit-flies like a banana
                 Kevin Street. Dublin 8. Ireland.   

harlow@plains.UUCP (Jay B. Harlow) (04/08/90)

In article <7442.261cbd19@dit.ie> alawlor@dit.ie (Aengus Lawlor) writes:
>In article <1990Mar31.034515.7622@rducky.uucp>, jrp@rducky.uucp (JIM PICKERING) writes:
>> I am writing an application that needs to determine is a logical drive
>> (E for example) is a ramdisk.  Is there any way?  Perhaps there is some
>> information in the BPD obtained through an ioctl() call?
>Can you get the date associated with the label on the drive?
>If it's todays date, it's probably a ram drive.
>
>(Not perfect, but reasonably do-able)
>--


Hello,
   Sorry This is NOT a good or Doable idea, My ramdisk, (MS-RAMDRIVE) returns
a date on the ramdisk of Jun(?) of 1985, which is 5 years ago.  Which
I think is the date the thing was complied or the date the programmer chose
'at random' to stick on the label image in his source code. This is Much
simpler way of doing it then creating the image when then driver is ran.
ON 3.3 and higher there are a couple funcky IOCTL functions that may shead
some light (don't remember the numbers but someone posted it ). and I am
  ( like get device parameters, it is invalid function on my ramdrive )
rather certain VDISK has still another date on it, and so on.....

Actually if knowing if you disk is real or virtual maybe MS should provide
support (or document) how to do this on next Version of DOS!

                        Jay
--
                Jay B. Harlow   <harlow@plains.nodak.edu>
        uunet!plains!harlow (UUCP)      harlow@plains (Bitnet)

Of course the above is personal opinion, And has no bearing on reality...

nfs@notecnirp.Princeton.EDU (Norbert Schlenker) (04/10/90)

In article <4049@plains.UUCP> harlow@plains.UUCP (Jay B. Harlow) writes:
>In article <7442.261cbd19@dit.ie> alawlor@dit.ie (Aengus Lawlor) writes:
>>In article <1990Mar31.034515.7622@rducky.uucp>, jrp@rducky.uucp (JIM PICKERING) writes:
>>> I am writing an application that needs to determine is a logical drive
>>> (E for example) is a ramdisk.  Is there any way?  Perhaps there is some
>>> information in the BPD obtained through an ioctl() call?

The infamous SI in Norton Utilities appears to be quite reliable when
it comes to determining what sort of device a drive is.  I don't know
that it's foolproof, but SI has always come up with the right total
for floppies, hard drives, and RAM disks on any machine I've used. Try
spending a little time with Codeview (or debug if you have more
patience) to see how it does what it does.

This technique worked well for me when I needed a method for
distinguishing NEC V20/V30 chips from Intel 8088/8086 chips.

Since SI is copyright Norton Computing, I advise you not to steal the
code outright.  The technique it uses (whatever it is) is freely
available.

Norbert

dixon@sagittarius.crd.ge.com (walt dixon) (04/13/90)

In a follow up to a previous posting Steve Resnick (stever@octopus.UUCP)
writes:

>Floppies have one fat also, but I would think that if you checked the number
>of FAT's on drives C: and higher you should be able to find the "Ram Disk"
>but this will still fail on any other IBM format block device which uses
> one fat. (I don't know if net drives will show up this way)...

The floppy disks that I have looked at (360K 5.25", 1.2M 5.25" and 720K
3.25") all have two FATs;  at least that is what the boot record claims.
As far as network drives go,  there can be no assumptions made as to
their structure,  ie they may not be msdos block devices.  The versions
of DOS with which I am familiar do not allow absolute reads/writes to
network devices for this reason.  The status field of the current directory
structure has bit 15 set for network devices.

Although there is no technical reason why a ram disk could not be made
available as a network resource,  I feel that a networked ram disk is
of limited usefulness;  consequently I would assume that a networked
device is not a ram disk.

Walt Dixon		{arpa:		dixon@crd.ge.com	}
			{us mail:	ge-crd			}
			{		po box 8		}
			{		schenectady, ny 12301	}
			{phone:		518-387-5798		}
Walt Dixon dixon@crd.ge.com