RAW sector read...

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

RAW sector read...

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
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: RAW sector read...

Michael Van Canneyt


On Mon, 3 Apr 2006, MihaiR wrote:

> 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.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: RAW sector read...

Felipe Monteiro de Carvalho
On 4/3/06, Michael Van Canneyt <[hidden email]> 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
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal