CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 1999
    Posts
    12

    Determining File System

    Is there any way in VC++ to determine the file system of the operating system at the runtime.
    I mean any function which returns whether the file system is NTFS or FAT32 .


  2. #2
    Join Date
    Sep 1999
    Location
    Ontario, Canada.
    Posts
    90

    Re: Determining File System

    Anand;

    You can call a function called GetVolumeInformation(). Below is a code snippit;

    char volname[32] ; // volume name to be returned
    long ser_num; // unique serial number of drive.
    long maxfilelen; // maximum length of filename supported.
    long fs_flags; // particular flags related to file system.
    char fs_type[32]; // name of file system on this drive.
    BOOL retval;

    retval GetVolumeInformation ( "c:\\", volname, sizeof ( volname ), &ser_num, &maxfilelen, &fs_flags, fs_type, sizeof ( fs_type ) ) ;

    The return value in fs_type returns "FAT", "FAT32", "NTFS", etc.

    To find out what the boot drive was, take a look at the environment variables. In Windows 95, my setting is

    winbootdir=c:\win95

    Hope this helps.



    -Peter.

  3. #3
    Join Date
    Aug 1999
    Posts
    12

    Re: Determining File System

    Thanx Peter it was a useful suggestion.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured