Network-NineP-0.4.2: High-level abstraction over 9P protocol

StabilityUltra-Violence
PortabilityI'm too young to die
Safe HaskellSafe
LanguageHaskell98

Network.NineP.File

Description

Higher-level file patterns. Don't support read/write operations at offsets and handling stat changes as for now.

Synopsis

Documentation

isDir Source #

Arguments

:: Word32

Permissions

-> Bool 

Tests if the file is a directory

simpleFile Source #

Arguments

:: (Monad m, EmbedIO m, ReadRef rr m a, Convertible a ByteString, WriteRef wr m b, Convertible ByteString b) 
=> String

File name

-> rr

Reading function

-> wr

Writing function

-> NineFile m 

A file that reads from and writes to the supplied Ref instances, with converstion to the appropriate types. See Instances, Instances and Instances. Use '()', if the file is meant to be read-only/write-only.

simpleFileBy Source #

Arguments

:: (Monad m, EmbedIO m) 
=> String

File name

-> (m a, b -> m ())

Reading and writing handle

-> (a -> ByteString, ByteString -> b)

Type conversion handles

-> NineFile m 

Typeclass-free version of simpleFile.

simpleDirectory Source #

Arguments

:: (Monad m, EmbedIO m) 
=> String

File name

-> (String -> m (NineFile m))

A function for creating new files

-> (String -> m (NineFile m))

A function for creating new directories

-> IO (NineFile m, IORef [(String, NineFile m)]) 

A directory that stores its contents in the form of 'IORef [(String, NineFile m)]'

rwFile Source #

Arguments

:: EmbedIO m 
=> String

File name

-> Maybe (m ByteString)

Read handler

-> Maybe (ByteString -> m ())

Write handler

-> NineFile m 

A file that reads and writes using simple user-specified callbacks.

memoryFile Source #

Arguments

:: (Monad m, EmbedIO m) 
=> String

File name

-> IO (NineFile m) 

A file that stores its contents in the form of IORef ByteString

memoryDirectory Source #

Arguments

:: (Monad m, EmbedIO m) 
=> String

File name

-> IO (NineFile m) 

A composition of a simpleDirectory and a memoryFile