Thread: read write from hard disk

  1. #1
    Registered User
    Join Date
    Apr 2006
    Posts
    4

    read write from hard disk

    Hello!

    I would like to ask how to read or write to/from hard disk in C. for example input to program is sector, and output must be the data on this sector, and if sector belong to any file? can anybody help me... please!

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Which OS
    Which compiler
    Which file system
    Which ....
    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.

  3. #3
    Registered User
    Join Date
    Apr 2006
    Posts
    4
    linux OS distribution kubuntu
    gcc compiler
    FAT 32 file system

  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
    Maybe this?
    http://www.nondot.org/sabre/os/articles/FileSystems/

    IIRC, you can (as root) open the entire hard disk, eg. "/dev/hda" as a file, and do whatever you want as a single large regular file.

    std_disclaimer.h
    If you screw this up with inept programming and lose your entire disk, don't blame me for handing you a loaded gun.
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. FILES (read & write)
    By gavra in forum C Programming
    Replies: 24
    Last Post: 06-16-2008, 01:22 AM
  2. read write lock in C#
    By George2 in forum C# Programming
    Replies: 0
    Last Post: 04-16-2008, 08:49 AM
  3. hard disk serial number
    By vijayaroli in forum Windows Programming
    Replies: 1
    Last Post: 08-31-2006, 03:00 AM
  4. Read and write hanging
    By zee in forum C Programming
    Replies: 8
    Last Post: 08-03-2004, 11:19 PM
  5. My graphics library
    By stupid_mutt in forum C Programming
    Replies: 3
    Last Post: 11-26-2001, 06:05 PM