How do I figure out what the disk format is?

This is a discussion on How do I figure out what the disk format is? within the C Programming forums, part of the General Programming Boards category; Which function in C helps me to determine what the disk format of the drive is that I am going ...

  1. #1
    Registered User mlupo's Avatar
    Join Date
    Oct 2001
    Posts
    72

    How do I figure out what the disk format is?

    Which function in C helps me to determine what the disk format of the drive is that I am going to r+w a file on?
    I need to determine whether it's NTFS or FAT32, etc.

    Thanks,
    Mike
    NEVER PET YOUR DOG WHILE IT'S ON FIRE!

  2. #2
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,622
    You could run a separate script to figure it out, (like Python or something) and have it report back to your C program, just to give you an idea. The only thing I know about that is you'll need to use a function called execv() in unistd.h

    Here's the manpage: http://unixhelp.ed.ac.uk/CGI/man-cgi?exec+3

    I'm sorry I can't help you more.

  3. #3
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    This isn't part of c since c functions don't care about the file system format the OS takes care of that. If your OS allows you to open a disk drive as a file then you can examine it and determine which file system is in use.

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,417
    > I need to determine whether it's NTFS or FAT32, etc.
    Why?
    Nothing in the standard C library gives a damn about such things.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  5. #5
    Registered User
    Join Date
    Mar 2005
    Location
    Mountaintop, Pa
    Posts
    1,059

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Disk failure in 3 disk RAID0 & 5?
    By cpjust in forum Tech Board
    Replies: 12
    Last Post: 12-22-2008, 09:09 AM
  2. about to format :/
    By MisterSako in forum Tech Board
    Replies: 7
    Last Post: 06-13-2005, 07:51 PM
  3. how m i ever going to format this thing
    By GanglyLamb in forum Tech Board
    Replies: 1
    Last Post: 04-13-2003, 11:58 AM
  4. writing a utility for format a file
    By powinda in forum C Programming
    Replies: 8
    Last Post: 02-12-2003, 05:55 PM
  5. format for printer
    By bigtamscot in forum C Programming
    Replies: 1
    Last Post: 10-06-2001, 04:59 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21