
9 Jun
2005
9 Jun
'05
1:47 a.m.
Hi, there, Could anyone tell me how to open a block device (e.g., /dev/hda1) into a IO Handle by using GHC (version > 5.0)? I want to open a block/char device and return a handle. Apparently, openFile function can't do the job. It will be very appreciated if someone could give me a hint. An earlier post pointed out the problem, but got no reply. http://www.haskell.org/pipermail/glasgow-haskell-users/2001-November/002624.... Something I played in GHCI-6.2.2 *Main> openFile "/dev/hdb2" ReadMode >>= \hin -> hGetPosn hin >>= \pos -> print pos *** Exception: /dev/hdb2: openFile: unsupported operation (unknown file type) (I already set /dev/hdb2 globally read/write) Cheers, Lei
7334
Age (days ago)
7334
Last active (days ago)
0 comments
1 participants
participants (1)
-
Lei Pan