1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

A purely out-of-curiosity question about @DriveType and @DriveTypeEx

Discussion in 'Support' started by mathewsdw, Feb 8, 2012.

  1. mathewsdw

    Joined:
    May 24, 2010
    Messages:
    855
    Likes Received:
    0
    I had a reason to use @DriveType (and this question also applies to @DriveTypeEx), and I noticed that the drive type for my Z: drive is given as "3" ("fixed disk"), where, as I have often mentioned before in this forum, my Z: drive really is a RAM disk. So how is a drive that is recognized as a RAM disk by @DriveType actually created?

    - Dan
     
  2. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,277
    Likes Received:
    38
    It's probably just calling down to the Windows GetDriveType() function. I have no idea how that works internally, but....

    A typical RAMdisk emulates a hard drive, which makes them hard to distinguish. Back in DOS days, one method of differentiating between them was to count the file allocation tables: a "hard drive" with only one FAT was probably a RAMdrive. Have you perhaps reformatted your RAMdrive? Made it NTFS? That would bollix my simpleminded test for sure.
     
  3. mathewsdw

    Joined:
    May 24, 2010
    Messages:
    855
    Likes Received:
    0
    Charles, I kind of suspect the same as well (I didn't bother to take the time to actually look for a Windows "GetDriveType()" API function but I really thought that such a thing probably existed and apparently I was right; and Rex's code seems to be more reliable than the native Windows code, anyway! :)); and yes, it is formatted as NTFS.
     

Share This Page