Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2006-04

RAW sector read...

3 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

MihaiR

Hello,

I'd like to read raw sectors (blocks) from removable devices (such as USB drives) from Linux and/or Windows. Is there any possibility to use FPC with that?

Thank you very much,
Mihai

Michael Van Canneyt
to MihaiR
MihaiR wrote 7 lines
Hello, I'd like to read raw sectors (blocks) from removable devices (such as USB drives) from Linux and/or Windows. Is there any possibility to use FPC with that? Thank you very much,

Under linux, I suppose you can simply open the file device. /dev/sgN, under windows, I don't know.

In each case, FPC does not offer a platform independent low-level hardware access... The naming schemes for devices are wildly different on these platforms...

Michael.

Felipe Monteiro de Carvalho
to Michael Van Canneyt
Michael Van Canneyt wrote
I'd like to read raw sectors (blocks) from removable devices (such as USB drives) from Linux and/or Windows. Is there any possibility to use FPC with that?

On Linux you can read the device like a normal file.

On Windows there is probably a API function to do this. Do some googling to find it.

And then use {$ifdef Win32} and other conditional compiles to ensure it compiles across all platforms.

There is some explanation on how to use the conditional compiles here:

http://wiki.lazarus.freepascal.org/index.php/Hardware_Access

Felipe Monteiro de Carvalho