The knob package
Create memory-backed Handles, referencing virtual files. This is mostly useful for testing Handle-based APIs without having to interact with the filesystem.
import Data.ByteString (pack)
import Data.Knob
import System.IO
main = do
knob <- newKnob (pack [])
h <- newFileHandle knob "test.txt" WriteMode
hPutStrLn h "Hello world!"
hClose h
bytes <- Data.Knob.getContents knob
putStrLn ("Wrote bytes: " ++ show bytes)
Properties
| Versions | 0.1, 0.1.1 |
|---|---|
| Dependencies | base (≥4.2 & <5.0), bytestring (≥0.9), transformers (≥0.2) |
| License | MIT |
| Author | John Millikin <jmillikin@gmail.com> |
| Maintainer | John Millikin <jmillikin@gmail.com> |
| Stability | experimental |
| Category | System |
| Home page | https://john-millikin.com/software/knob/ |
| Bug tracker | mailto:jmillikin@gmail.com |
| Source repository | bzr branch https://john-millikin.com/software/knob/ |
| Upload date | Sun Apr 8 18:48:04 UTC 2012 |
| Uploaded by | JohnMillikin |
| Built on | ghc-7.4 |
Modules
- Data
Downloads
- knob-0.1.1.tar.gz (Cabal source package)
- package description (included in the package)