[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
guile/guile-core/doc scheme-io.texi
From: |
Gary Houston |
Subject: |
guile/guile-core/doc scheme-io.texi |
Date: |
Mon, 04 Jun 2001 14:51:02 -0700 |
CVSROOT: /cvs
Module name: guile
Changes by: Gary Houston <address@hidden> 01/06/04 14:51:02
Modified files:
guile-core/doc : scheme-io.texi
Log message:
* scheme-io.texi (Block Reading and Writing): added
write-string/partial, updated read-string!/partial.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/doc/scheme-io.texi.diff?cvsroot=OldCVS&tr1=1.15&tr2=1.16&r1=text&r2=text
Patches:
Index: guile/guile-core/doc/scheme-io.texi
diff -u guile/guile-core/doc/scheme-io.texi:1.15
guile/guile-core/doc/scheme-io.texi:1.16
--- guile/guile-core/doc/scheme-io.texi:1.15 Wed May 30 13:32:05 2001
+++ guile/guile-core/doc/scheme-io.texi Mon Jun 4 14:51:01 2001
@@ -407,15 +407,17 @@
(use-modules (ice-9 rw))
@end smalllisp
-It currently contains a single procedure which helps implement
-the @code{(scsh rw)} module in guile-scsh.
+It currently contains procedures that help to implement the
address@hidden(scsh rw)} module in guile-scsh.
address@hidden primitive read-string!/partial str [port_or_fdes] [start] [end]
-Read characters from an fport or file descriptor into a
-string @var{str}. This procedure is scsh-compatible
-and can efficiently read large strings. It will:
address@hidden primitive read-string!/partial str [port_or_fdes start end]
+Read characters from a port or file descriptor into a
+string @var{str}. A port must have an underlying file
+descriptor --- a so-called fport. This procedure is
+scsh-compatible and can efficiently read large strings.
+It will:
address@hidden @bullet
address@hidden
@item
attempt to fill the entire string, unless the @var{start}
and/or @var{end} arguments are supplied. i.e., @var{start}
@@ -425,12 +427,16 @@
use the current input port if @var{port_or_fdes} is not
supplied.
@item
-read any characters that are currently available,
-without waiting for the rest (short reads are possible).
-
+return fewer than the requested number of characters in some
+cases, e.g., on end of file, if interrupted by a signal, or if
+not all the characters are immediately available.
address@hidden
+wait indefinitely for some input if no characters are
+currently available,
+unless the port is in non-blocking mode.
@item
-wait for as long as it needs to for the first character to
-become available, unless the port is in non-blocking mode
+read characters from the port's input buffers if available,
+instead from the underlying file descriptor.
@item
return @code{#f} if end-of-file is encountered before reading
any characters, otherwise return the number of characters
@@ -440,10 +446,53 @@
are immediately available.
@item
return 0 if the request is for 0 bytes, with no
-end-of-file check
+end-of-file check.
@end itemize
@end deffn
address@hidden primitive write-string/partial str [port_or_fdes start end]
+Write characters from a string @var{str} to a port or file
+descriptor. A port must have an underlying file descriptor
+--- a so-called fport. This procedure is
+scsh-compatible and can efficiently write large strings.
+It will:
+
address@hidden
address@hidden
+attempt to write the entire string, unless the @var{start}
+and/or @var{end} arguments are supplied. i.e., @var{start}
+defaults to 0 and @var{end} defaults to
address@hidden(string-length str)}
address@hidden
+use the current output port if @var{port_of_fdes} is not
+supplied.
address@hidden
+in the case of a buffered port, store the characters in the
+port's output buffer, if all will fit. If they will not fit
+then any existing buffered characters will be flushed
+before attempting
+to write the new characters directly to the underlying file
+descriptor. If the port is in non-blocking mode and
+buffered characters can not be flushed immediately, then an
address@hidden system-error exception will be raised (Note:
+scsh does not support the use of non-blocking buffered ports.)
address@hidden
+write fewer than the requested number of
+characters in some cases, e.g., if interrupted by a signal or
+if not all of the output can be accepted immediately.
address@hidden
+wait indefinitely for at least one character
+from @var{str} to be accepted by the port, unless the port is
+in non-blocking mode.
address@hidden
+return the number of characters accepted by the port.
address@hidden
+return 0 if the port is in non-blocking mode and can not accept
+at least one character from @var{str} immediately
address@hidden
+return 0 immediately if the request size is 0 bytes.
address@hidden itemize
address@hidden deffn
@node Default Ports
@section Default Ports for Input, Output and Errors
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- guile/guile-core/doc scheme-io.texi,
Gary Houston <=