PAGE2GO2 HOME | INTERNET NEWS

LeighExchange - Free Advertising Network Stock Research at Internet Speed

Re: Raw disk access

 List
Subject: Re: Raw disk access
Poster: FlashGordonspam@flash-gordon.me.uk
Date: Fri, 23 Mar 2007 20:08:17 +0000
Related Postings: 1 2 3 4 5
daya wrote, On 23/03/07 16:54:
> To access the USB drive in raw mode in Linux...do not mount the drive.
> Just search the device file in the folder /dev
> It will probably be /dev/sda or /dev/sdc.
>
> Since all the devices are treated as files in linux.you can use the
> file in raw mode
> in C/C++ program

I think you mean binary mode, C does not have a raw mode.


> eg
>
> FILE* fp=fopen("/dev/sda","r");

That would open it in text mode which is not what you want (although it does not make much difference on Linux). You should use "rb" for binary.


> etc.
> For writing you may probably need to run the program as root.

All this would be best discussed on a Linux or Unix programming group where the specifics of the system are topical. They are not topical here. -- Flash Gordon

 

Page2Go2.com is not responsible for content of this message.