[Haskell-beginners] using HS to writing/managing a selfmade filesystem on a real partition?
Sylvain Henry
sylvain at haskus.fr
Mon May 9 21:12:39 UTC 2016
Hi,
You don't have to write a kernel module (which would better be written
in C), you can do everything in userspace and in Haskell with FUSE:
https://en.wikipedia.org/wiki/Filesystem_in_Userspace
It seems to already have Haskell bindings:
https://hackage.haskell.org/package/HFuse-0.2.4.5/docs/System-Fuse.html
To implement the file system operations, you can use binary
(https://hackage.haskell.org/package/binary), Foreign.Ptr, Data.Bits,
etc. You can write data on any real partition by using the associated
block devices (e.g., /dev/sda1).
Sylvain
On 09/05/2016 20:50, Silent Leaf wrote:
> Mostly all in the title.
>
> I have a project of developing a personal filesystem, possibly at
> first virtual (the file(s) representing a virtual partition formatted
> with my filesystem, would be saved in a host filesys, eg ext4 or
> whatever), but probably in the end not virtual, directly working on
> the contents of a real partition.
>
> Can haskell do that kind of thing, aka writing data on a partition
> directly (without using a known filesys), etc? Is it at least more or
> less adapted for this task (not talking about performances, unless the
> consequences be a *really* slow filesys), aka doable, easily doable,
> relatively speaking (aka not worse than with another language)?
> Incidentally, if i wanted Linux to recognize the filesys, i've heard
> one has to write a module and put it in connection with the kernel or
> something. could haskell do that?
>
> if that's a "no" somewhere for one of my questions, which parts can't
> be written in haskell (without horrible performances or code very very
> hard to write), and can they be written in C (or whatever) as foreign
> functions? which parts would that represent for the whole program?
>
> Thanks a lot in advance!
>
> PS: just in case, tips on sources of information on how to do any of
> the above will be extremely appreciated! (even if it's in, say C, for
> that matter, providing there's a way to translate the steps into a
> haskell program)
>
>
> _______________________________________________
> 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/20160509/e3a23aaf/attachment.html>
More information about the Beginners
mailing list