[Haskell-beginners] R/W from/to partitions (on linux)

Sylvain Henry sylvain at haskus.fr
Mon Jun 26 05:51:41 UTC 2017


Hi,

It is not Haskell specific. You just have to read from the partition 
device special file (e.g., something like /dev/sdb2) as you would do 
with a normal file. You must have the permission to do so (e.g., be 
root). Be careful as you can destroy your system if you write something 
incorrect in your partitions.

Repositioning handles: 
https://www.stackage.org/haddock/lts-8.20/base-4.9.1.0/System-IO.html#g:13

Read/write: 
https://www.stackage.org/haddock/lts-8.20/base-4.9.1.0/System-IO.html#v:hPutBuf

Sylvain


On 26/06/2017 07:35, Silent Leaf wrote:
> Hi,
>
> I'd like to be able to read and write from/to partitions directly. 
> I've had trouble with the documentation (honestly i can't find 
> anything, and any mention of partitions leads to mathematical 
> partitioning of lists or whatever).
>
> I obviously would need to be able to write or read from a specific 
> position in the partition. Mind you that would be good too for files 
> (that is, being able to read/write from a specific position in it) 
> since i plan on making disk images.
>
> Thanks in advance!
>
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20170626/3bb0b680/attachment.html>


More information about the Beginners mailing list