read write from hard disk

This is a discussion on read write from hard disk within the C Programming forums, part of the General Programming Boards category; Hello! I would like to ask how to read or write to/from hard disk in C. for example input to ...

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

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, 05:05 PM

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