openFileAsSocketF :: FudgetIO f => String -> String -> (Socket -> f hi ho) -> f hi ho
openFileAsSocketF filename iomode fudget
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
).
filename :: String
iomode :: String
fopen()
. The strings
"r"
, "w"
and "rw"
indicate read-only, write-only
and read/write access, respectively.
fudget :: Socket -> f hi ho
Opening network sockets: openSocketF
Opening a file with error handling: openFileAsSocketErrF.
The manual page for fopen()
.