Thread: How do I figure out what the disk format is?

  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
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    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 int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > 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.

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

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, 10: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, 06:55 PM
  5. format for printer
    By bigtamscot in forum C Programming
    Replies: 1
    Last Post: 10-06-2001, 04:59 AM