ยค openFileAsSocketF

Sockets

Types

openFileAsSocketF :: FudgetIO f => String -> String -> (Socket -> f hi ho) -> f hi ho

Synopsis

openFileAsSocketF filename iomode fudget

Description

openFileAsSocketF allows objects in the file system to be accessed using the sockets machinery. This can be useful for communication via terminals (/dev/tty??), named pipes (created with the mkfifo command), or the audio device (typically /dev/audio).

Arguments

filename :: String
The name of the file to open
iomode :: String
A mode string, as for the C function fopen(). The strings "r", "w" and "rw" indicate read-only, write-only and read/write access, respectively.

fudget :: Socket -> f hi ho
A fudget, e.g., transceiverF, that uses the created socket.

See Also

Opening network sockets: openSocketF

Opening a file with error handling: openFileAsSocketErrF.

The manual page for fopen().