![]() | Library Documentation | Structures | Signatures | Identifiers | Packages | About |
OS_IO (basis)Interface for I/O devices.
The OS.IO structure provides a general interface for polling I/O devices. This interface has been modeled after the Unix SVR4 poll interface. A poll_desc, created from an I/O descriptor, can be used to test for various polling conditions.signature OS_IO =
sig
eqtype iodesc
val hash : iodesc -> word
val compare : iodesc * iodesc -> order
eqtype iodesc_kind
(*
val kind : iodesc -> iodesc_kind
*)
structure Kind : sig
val file : iodesc_kind
val dir : iodesc_kind
val symlink : iodesc_kind
val tty : iodesc_kind
val pipe : iodesc_kind
val socket : iodesc_kind
val device : iodesc_kind
end
(*
eqtype poll_desc
type poll_info
val pollDesc : iodesc -> poll_desc option
val pollToIODesc : poll_desc -> iodesc
exception Poll
val pollIn : poll_desc -> poll_desc
val pollOut : poll_desc -> poll_desc
val pollPri : poll_desc -> poll_desc
val poll : poll_desc list * Time.time option -> poll_info list
val isIn : poll_info -> bool
val isOut : poll_info -> bool
val isPri : poll_info -> bool
val infoToPollDesc : poll_info -> poll_desc
*)
end
hash must have the property that values produced are well
distributed when taken modulo 2(n) for any n.
[file] A regular file in the file system. The I/O descriptor
associated with a stream produced by one of the BinIO or TextIO
file opening operations will always have this kind.
[dir] A directory in the file system. I/O descriptors associated
with file system objects for which OS.FileSys.isDir returns true
will have this kind.
[symlink] A symbolic link or file system alias. I/O descriptors
associated with file system objects for which OS.FileSys.isLink
returns true will have this kind.
[tty] A terminal console.
[pipe] A pipe to another system process.
[socket] A network socket.
[device] A logical or physical hardware device.