[Lazarus] How can I write to arbitrary position on device

Mark Morgan Lloyd markMLl.lazarus at telemetry.co.uk
Thu Apr 13 09:15:17 CEST 2017


On 12/04/17 21:30, Carlos E. R. via Lazarus wrote:
> Hi,
> I'm new on this list, so if I should post this to a different place,
> just tell me.
> I want to find a function that I can use on Linux to write a memory
> block to an arbitrary position on a device, say, /dev/sda or /dev/sda5 .
> I can do that on an opened file with seek() and write(), but apparently
> only on files. I need accessing the raw disk device. So currently I call
> 'dd' instead.
> I also had problems with blockread/write: it failed reading more than
> one megabyte.

That's interesting, I need to look at some medium testing stuff over the 
next few days and was assuming I'd need to check the dd sources. Are you 
running as root to get direct access to the device?

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]


More information about the Lazarus mailing list