module Dup:Convenience operators for specifying shell-style dups.sig
..end
This module provides one prefix operator and a surfeit of infix
operators. The prefix operator Channel.Dup.(!%)
reveals the integer value of
an abstract UNIX file descriptor. The infix operators are for
specifying dups, as follows:
Channel.dup2
and corresponds to the syntax of the Bourne
shell.<
or >
indicates the direction of IO: <
is for input
channels and >
for output channels.*
is for Channel.gen_in_channel
s and Channel.gen_out_channel
s%
is for integer file descriptors/
is for in_channel
s and out_channel
s(!%)
on Channel.descr
to get an int
suitable for the %
operations.)&
means the second argument is the same type as the first*
, %
, /
are as for the first argument<
opens a file for reading>
opens a file for writing, using the mode from Channel.clobber
>!
opens for writing, always clobbering (`Clobber
)>?
opens for writing, never clobbering (`NoClobber
)>>
opens for appending (`Append
)>>!
opens for appending but won't create (`AppendOnly
) 2 %>& 1
redirects error output onto standard output 0 %< "file"
redirects input to come from the file 1 %>/ c
, where c : out_channel
, redirects standard output
into the channel c /<* `Close
closes c : in_channel
typedup_arg =
Channel.dup_source * Channel.gen_channel
val (!%) : Channel.descr -> int
val ( *<& ) : Channel.gen_in_channel -> Channel.dup_in_source -> dup_arg
val ( *< ) : Channel.gen_in_channel -> string -> dup_arg
Channel.gen_in_channel
.val ( *>& ) : Channel.gen_out_channel -> Channel.dup_out_source -> dup_arg
val ( *> ) : Channel.gen_out_channel -> string -> dup_arg
Channel.gen_out_channel
.val ( *>! ) : Channel.gen_out_channel -> string -> dup_arg
Channel.gen_out_channel
, clobbering.val ( *>? ) : Channel.gen_out_channel -> string -> dup_arg
Channel.gen_out_channel
, without clobbering.val ( *>> ) : Channel.gen_out_channel -> string -> dup_arg
Channel.gen_out_channel
, appending.val ( *>>! ) : Channel.gen_out_channel -> string -> dup_arg
Channel.gen_out_channel
, appending, without
creating.val (%<&) : int -> int -> dup_arg
val (%<) : int -> string -> dup_arg
val (%>&) : int -> int -> dup_arg
val (%>) : int -> string -> dup_arg
val (%>!) : int -> string -> dup_arg
val (%>?) : int -> string -> dup_arg
val (%>>) : int -> string -> dup_arg
val (%>>!) : int -> string -> dup_arg
val (/<&) : Pervasives.in_channel -> Pervasives.in_channel -> dup_arg
in_channel
from another in_channel
.val (/<) : Pervasives.in_channel -> string -> dup_arg
in_channel
.val (/>&) : Pervasives.out_channel -> Pervasives.out_channel -> dup_arg
out_channel
from another out_channel
.val (/>) : Pervasives.out_channel -> string -> dup_arg
out_channel
.val (/>!) : Pervasives.out_channel -> string -> dup_arg
out_channel
, clobbering.val (/>?) : Pervasives.out_channel -> string -> dup_arg
out_channel
, without clobbering.val (/>>) : Pervasives.out_channel -> string -> dup_arg
out_channel
, appending.val (/>>!) : Pervasives.out_channel -> string -> dup_arg
out_channel
, appending, without
creating.val ( *>% ) : Channel.gen_out_channel -> int -> dup_arg
Channel.gen_out_channel
from a file descriptor.val ( *>/ ) : Channel.gen_out_channel -> Pervasives.out_channel -> dup_arg
val ( %>* ) : int -> Channel.dup_out_source -> dup_arg
Channel.dup_out_source
.val (%>/) : int -> Pervasives.out_channel -> dup_arg
out_channel
.val ( />* ) : Pervasives.out_channel -> Channel.dup_out_source -> dup_arg
val (/>%) : Pervasives.out_channel -> int -> dup_arg
out_channel
from a file descriptor.val ( *<% ) : Channel.gen_in_channel -> int -> dup_arg
Channel.gen_in_channel
from a file descriptor.val ( *</ ) : Channel.gen_in_channel -> Pervasives.in_channel -> dup_arg
val ( %<* ) : int -> Channel.dup_in_source -> dup_arg
Channel.dup_in_source
.val (%</) : int -> Pervasives.in_channel -> dup_arg
in_channel
.val ( /<* ) : Pervasives.in_channel -> Channel.dup_in_source -> dup_arg
val (/<%) : Pervasives.in_channel -> int -> dup_arg
in_channel
from a file descriptor.