FunctionPackage: exclToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version

read-no-hang-p

Arguments: stream

In brief, if the argument stream is an integer, read-no-hang-p views that integer as an output file-descriptor, and it just checks the file-descriptor for readiness. If stream is a stream, its input-handle is queried to see if reading can be done. True is returned if reading can be done, else nil is returned. If the handle is itself a stream (an encapsulation), the stream is examined in a way similar to a listen, but an eof or an error situation always causes a return of true.

The actual implementation is more complicated and probably of interest only to strategy-level programmers. See Simple-stream Description in streams.htm for a discussion of different sorts of programmers.

If stream is a dual-channel stream that has the record-end set to -1, read-no-hang-p will call device-finish-record with :listen as the value of the blocking argument and :prime-input as the value of the action, and return nil if that call returns nil, or t if that call returns :eof.

For other stream types, the buffer is checked for emptiness. If it is not empty, t is returned (after a possible record-end check - see below).

If the buffer is empty, then device-read is called with a blocking argument of nil. Any eof or error condition will result in t being returned, and if no octets were read otherwise, nil is returned.

If stream is a dual-channel stream with record-end set, and if the read was able to get some data, or if the buffer was not empty to start with, the the record end is checked. If the record has ended, then device-finish-record is called with null blocking argument and action :input, and if it returns nil, nil is returned. Otherwise, t is returned.

See streams.htm for information on the simple-streams implementation in Allegro CL.


Copyright (c) 1998-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version