author | Stefan Vogel <sv@exept.de> |
Mon, 22 Jun 2015 11:33:37 +0200 | |
branch | expecco_2_7_5_branch |
changeset 18499 | b132ac7c9d6a |
parent 16348 | 7860486a31a0 |
child 17607 | 224f253b60c8 |
permissions | -rw-r--r-- |
1 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
177 | 3 |
All Rights Reserved |
1 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
5407 | 12 |
"{ Package: 'stx:libbasic' }" |
13 |
||
1344
32a51164b237
No longer a subclass of UnboundedExternalStream, now subclass of ExternalStream.
Stefan Vogel <sv@exept.de>
parents:
1295
diff
changeset
|
14 |
ExternalStream subclass:#NonPositionableExternalStream |
1295 | 15 |
instanceVariableNames:'' |
16 |
classVariableNames:'StdInStream StdOutStream StdErrorStream' |
|
17 |
poolDictionaries:'' |
|
18 |
category:'Streams-External' |
|
1 | 19 |
! |
20 |
||
613 | 21 |
!NonPositionableExternalStream primitiveDefinitions! |
22 |
%{ |
|
2896 | 23 |
|
5918 | 24 |
#ifndef _STDIO_H_INCLUDED_ |
25 |
# include <stdio.h> |
|
26 |
# define _STDIO_H_INCLUDED_ |
|
27 |
#endif |
|
3956
51f1a9a4d63f
changes for egcs (stdio uses __new / utsname)
Claus Gittinger <cg@exept.de>
parents:
3808
diff
changeset
|
28 |
|
10410 | 29 |
#ifndef REMOVE_LATER |
30 |
# define __win32_stdout() stdout |
|
31 |
# define __win32_stderr() stderr |
|
32 |
# define __win32_stdin() stdin |
|
33 |
#else |
|
34 |
extern FILE *__win32_stdin(); |
|
35 |
extern FILE *__win32_stderr(); |
|
36 |
extern FILE *__win32_stdout(); |
|
37 |
#endif |
|
38 |
||
613 | 39 |
%} |
40 |
||
41 |
! ! |
|
42 |
||
88 | 43 |
!NonPositionableExternalStream class methodsFor:'documentation'! |
44 |
||
45 |
copyright |
|
46 |
" |
|
47 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
177 | 48 |
All Rights Reserved |
88 | 49 |
|
50 |
This software is furnished under a license and may be used |
|
51 |
only in accordance with the terms of that license and with the |
|
52 |
inclusion of the above copyright notice. This software may not |
|
53 |
be provided or otherwise made available to, or used by, any |
|
54 |
other person. No title to or ownership of the software is |
|
55 |
hereby transferred. |
|
56 |
" |
|
57 |
! |
|
58 |
||
59 |
documentation |
|
60 |
" |
|
61 |
This class provides common protocol for all non-positionable, |
|
62 |
external streams. Concrete subclasses are terminal streams, pipe streams, |
|
63 |
PrinterStreams, Sockets etc. |
|
64 |
||
65 |
There are three special instances of this class, representing stdin, |
|
66 |
stdout and stderr of the smalltalk/X process (see Unix manuals, if you |
|
177 | 67 |
dont know what those are used for). These special streams are bound to |
68 |
to globals Stdin, Stdout and Stderr at early initialization time |
|
69 |
(see Smalltalk>>initializeStandardStreams). |
|
159 | 70 |
|
71 |
The name of this class is a historical leftover - it should be called |
|
72 |
'TTYStream' or similar. |
|
1295 | 73 |
|
74 |
[author:] |
|
3808
5a7866138026
set eolMode of stderr & stdout to #crlf under win32
Claus Gittinger <cg@exept.de>
parents:
3173
diff
changeset
|
75 |
Claus Gittinger |
88 | 76 |
" |
216 | 77 |
! ! |
78 |
||
1 | 79 |
!NonPositionableExternalStream class methodsFor:'instance creation'! |
80 |
||
613 | 81 |
forStderr |
2965 | 82 |
"{ Pragma: +optSpace }" |
83 |
||
613 | 84 |
"return a NonPositionableExternalStream object for writing to |
85 |
Unixes standard error output file descriptor" |
|
86 |
||
87 |
StdErrorStream isNil ifTrue:[ |
|
88 |
StdErrorStream := self basicNew initializeForStderr |
|
89 |
]. |
|
90 |
^ StdErrorStream |
|
91 |
! |
|
92 |
||
1 | 93 |
forStdin |
2965 | 94 |
"{ Pragma: +optSpace }" |
95 |
||
44 | 96 |
"return a NonPositionableExternalStream object for reading from |
97 |
Unixes standard input file descriptor" |
|
98 |
||
88 | 99 |
StdInStream isNil ifTrue:[ |
177 | 100 |
StdInStream := self basicNew initializeForStdin |
88 | 101 |
]. |
102 |
^ StdInStream |
|
1 | 103 |
! |
104 |
||
105 |
forStdout |
|
2965 | 106 |
"{ Pragma: +optSpace }" |
107 |
||
44 | 108 |
"return a NonPositionableExternalStream object for writing to |
109 |
Unixes standard output file descriptor" |
|
110 |
||
88 | 111 |
StdOutStream isNil ifTrue:[ |
177 | 112 |
StdOutStream := self basicNew initializeForStdout |
88 | 113 |
]. |
114 |
^ StdOutStream |
|
7497
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
115 |
! |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
116 |
|
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
117 |
makePTYPair |
10327 | 118 |
"return an array with two streams - the first one is the master, |
7497
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
119 |
the second the slave of a ptym/ptys pair. |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
120 |
This is much like a bidirectional pipe, but allows signals & |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
121 |
control chars to be passed through the connection. |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
122 |
This is needed to execute a shell in a view. |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
123 |
This is the higher level equivalent of OperatingSystem>>makePTYPair |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
124 |
(which returns an array of file-descriptors)." |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
125 |
|
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
126 |
|ptyPair master slave| |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
127 |
|
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
128 |
ptyPair := OperatingSystem makePTYPair. |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
129 |
ptyPair notNil ifTrue:[ |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
130 |
master := self forReadWriteToFileDescriptor:(ptyPair at:1). |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
131 |
master buffered:false. |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
132 |
slave := self forReadWriteToFileDescriptor:(ptyPair at:2). |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
133 |
slave buffered:false. |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
134 |
ptyPair at:1 put:master. |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
135 |
ptyPair at:2 put:slave. |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
136 |
^ ptyPair |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
137 |
]. |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
138 |
^ nil |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
139 |
|
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
140 |
" |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
141 |
ExternalStream makePTYPair. |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
142 |
" |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
143 |
|
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
144 |
"Modified: 29.2.1996 / 18:28:36 / cg" |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
145 |
! |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
146 |
|
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
147 |
makePipe |
10327 | 148 |
"return an array with two streams - the first one for reading, |
149 |
the second for writing. |
|
7497
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
150 |
This is the higher level equivalent of OperatingSystem>>makePipe |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
151 |
(which returns an array of file-descriptors)." |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
152 |
|
11907
98248eb75a8d
#retry makePipe after a failed try and garbageCollection
sr
parents:
11455
diff
changeset
|
153 |
|pipe rs ws| |
7497
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
154 |
|
11907
98248eb75a8d
#retry makePipe after a failed try and garbageCollection
sr
parents:
11455
diff
changeset
|
155 |
pipe := OperatingSystem makePipe. |
98248eb75a8d
#retry makePipe after a failed try and garbageCollection
sr
parents:
11455
diff
changeset
|
156 |
pipe isNil ifTrue:[ |
16348 | 157 |
"/ ok, maybe someone has forgotten to close a stream; enforce finalization and try again |
158 |
'makePipe: enforcing finalization to close any open streams' infoPrintCR. |
|
159 |
ObjectMemory garbageCollect; finalize. |
|
160 |
pipe := OperatingSystem makePipe. |
|
11907
98248eb75a8d
#retry makePipe after a failed try and garbageCollection
sr
parents:
11455
diff
changeset
|
161 |
]. |
12395
1db7ea277c93
filePointer -> handle migration
Claus Gittinger <cg@exept.de>
parents:
11907
diff
changeset
|
162 |
|
11907
98248eb75a8d
#retry makePipe after a failed try and garbageCollection
sr
parents:
11455
diff
changeset
|
163 |
pipe notNil ifTrue:[ |
16348 | 164 |
rs := self forFileDescriptor:(pipe at:1) mode:#readonly buffered:false handleType:#pipeFilePointer. |
165 |
ws := self forFileDescriptor:(pipe at:2) mode:#writeonly buffered:false handleType:#pipeFilePointer. |
|
166 |
^ Array with:rs with:ws |
|
11907
98248eb75a8d
#retry makePipe after a failed try and garbageCollection
sr
parents:
11455
diff
changeset
|
167 |
]. |
98248eb75a8d
#retry makePipe after a failed try and garbageCollection
sr
parents:
11455
diff
changeset
|
168 |
^ nil |
7497
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
169 |
|
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
170 |
" |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
171 |
|pipe rs ws| |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
172 |
|
7541 | 173 |
pipe := NonPositionableExternalStream makePipe. |
7497
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
174 |
rs := pipe at:1. |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
175 |
ws := pipe at:2. |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
176 |
|
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
177 |
'read ...'. |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
178 |
[ |
16348 | 179 |
1 to:10 do:[:i | |
180 |
Transcript showCR:rs nextLine |
|
181 |
]. |
|
182 |
rs close. |
|
7497
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
183 |
] forkAt:7. |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
184 |
|
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
185 |
'write ...'. |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
186 |
[ |
16348 | 187 |
1 to:10 do:[:i | |
188 |
ws nextPutAll:'hello world '; nextPutAll:i printString; cr |
|
189 |
]. |
|
190 |
ws close. |
|
7497
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
191 |
] fork. |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
192 |
" |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
193 |
|
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
194 |
"Modified: 29.2.1996 / 18:28:36 / cg" |
613 | 195 |
! ! |
196 |
||
16340
6203956d63ee
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
16207
diff
changeset
|
197 |
!NonPositionableExternalStream methodsFor:'accessing'! |
6203956d63ee
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
16207
diff
changeset
|
198 |
|
6203956d63ee
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
16207
diff
changeset
|
199 |
buffered:aBoolean |
16348 | 200 |
"do not allow to change to buffered mode - ignore true here" |
16340
6203956d63ee
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
16207
diff
changeset
|
201 |
|
16348 | 202 |
aBoolean ifFalse:[ |
203 |
super buffered:false. |
|
204 |
]. |
|
16340
6203956d63ee
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
16207
diff
changeset
|
205 |
! ! |
6203956d63ee
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
16207
diff
changeset
|
206 |
|
613 | 207 |
!NonPositionableExternalStream methodsFor:'error handling'! |
208 |
||
209 |
positionError |
|
2965 | 210 |
"{ Pragma: +optSpace }" |
211 |
||
613 | 212 |
"notify that this stream has no concept of a position" |
213 |
||
8320
229adaeaf183
Use exception classes instead of class vars
Stefan Vogel <sv@exept.de>
parents:
7861
diff
changeset
|
214 |
^ PositionError raiseRequestWith:self |
4559 | 215 |
|
216 |
" |
|
217 |
Stderr positionError |
|
218 |
" |
|
613 | 219 |
! ! |
220 |
||
15919
96f6c9fb9f7a
Initialize in instance initialize method insted in #new
Stefan Vogel <sv@exept.de>
parents:
15796
diff
changeset
|
221 |
!NonPositionableExternalStream methodsFor:'initialization'! |
96f6c9fb9f7a
Initialize in instance initialize method insted in #new
Stefan Vogel <sv@exept.de>
parents:
15796
diff
changeset
|
222 |
|
96f6c9fb9f7a
Initialize in instance initialize method insted in #new
Stefan Vogel <sv@exept.de>
parents:
15796
diff
changeset
|
223 |
initialize |
16340
6203956d63ee
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
16207
diff
changeset
|
224 |
"non-positionable streams do not work well when buffered" |
15919
96f6c9fb9f7a
Initialize in instance initialize method insted in #new
Stefan Vogel <sv@exept.de>
parents:
15796
diff
changeset
|
225 |
|
96f6c9fb9f7a
Initialize in instance initialize method insted in #new
Stefan Vogel <sv@exept.de>
parents:
15796
diff
changeset
|
226 |
super initialize. |
15922 | 227 |
buffered := false. |
15919
96f6c9fb9f7a
Initialize in instance initialize method insted in #new
Stefan Vogel <sv@exept.de>
parents:
15796
diff
changeset
|
228 |
! ! |
96f6c9fb9f7a
Initialize in instance initialize method insted in #new
Stefan Vogel <sv@exept.de>
parents:
15796
diff
changeset
|
229 |
|
7861
9c2cd42e4667
Provide a #nextBytes:into:startingAt: that does not block the whole ST/X
Stefan Vogel <sv@exept.de>
parents:
7682
diff
changeset
|
230 |
!NonPositionableExternalStream methodsFor:'non homogenous reading'! |
9c2cd42e4667
Provide a #nextBytes:into:startingAt: that does not block the whole ST/X
Stefan Vogel <sv@exept.de>
parents:
7682
diff
changeset
|
231 |
|
9c2cd42e4667
Provide a #nextBytes:into:startingAt: that does not block the whole ST/X
Stefan Vogel <sv@exept.de>
parents:
7682
diff
changeset
|
232 |
nextBytes:count into:anObject startingAt:start |
9c2cd42e4667
Provide a #nextBytes:into:startingAt: that does not block the whole ST/X
Stefan Vogel <sv@exept.de>
parents:
7682
diff
changeset
|
233 |
"read the next count bytes into an object and return the number of |
9c2cd42e4667
Provide a #nextBytes:into:startingAt: that does not block the whole ST/X
Stefan Vogel <sv@exept.de>
parents:
7682
diff
changeset
|
234 |
bytes read or the number of bytes read, if EOF is encountered before. |
9c2cd42e4667
Provide a #nextBytes:into:startingAt: that does not block the whole ST/X
Stefan Vogel <sv@exept.de>
parents:
7682
diff
changeset
|
235 |
An exception is raised if the connection is broken. |
9c2cd42e4667
Provide a #nextBytes:into:startingAt: that does not block the whole ST/X
Stefan Vogel <sv@exept.de>
parents:
7682
diff
changeset
|
236 |
|
9c2cd42e4667
Provide a #nextBytes:into:startingAt: that does not block the whole ST/X
Stefan Vogel <sv@exept.de>
parents:
7682
diff
changeset
|
237 |
Redefined here to avoid blocking of ST/X when waiting for io. |
9c2cd42e4667
Provide a #nextBytes:into:startingAt: that does not block the whole ST/X
Stefan Vogel <sv@exept.de>
parents:
7682
diff
changeset
|
238 |
Instead only the calling thread will block" |
9c2cd42e4667
Provide a #nextBytes:into:startingAt: that does not block the whole ST/X
Stefan Vogel <sv@exept.de>
parents:
7682
diff
changeset
|
239 |
|
8815 | 240 |
|remaining offset nRead| |
7861
9c2cd42e4667
Provide a #nextBytes:into:startingAt: that does not block the whole ST/X
Stefan Vogel <sv@exept.de>
parents:
7682
diff
changeset
|
241 |
|
9c2cd42e4667
Provide a #nextBytes:into:startingAt: that does not block the whole ST/X
Stefan Vogel <sv@exept.de>
parents:
7682
diff
changeset
|
242 |
count == 0 ifTrue:[ |
10327 | 243 |
^ 0. |
7861
9c2cd42e4667
Provide a #nextBytes:into:startingAt: that does not block the whole ST/X
Stefan Vogel <sv@exept.de>
parents:
7682
diff
changeset
|
244 |
]. |
9c2cd42e4667
Provide a #nextBytes:into:startingAt: that does not block the whole ST/X
Stefan Vogel <sv@exept.de>
parents:
7682
diff
changeset
|
245 |
|
9c2cd42e4667
Provide a #nextBytes:into:startingAt: that does not block the whole ST/X
Stefan Vogel <sv@exept.de>
parents:
7682
diff
changeset
|
246 |
remaining := count. |
9c2cd42e4667
Provide a #nextBytes:into:startingAt: that does not block the whole ST/X
Stefan Vogel <sv@exept.de>
parents:
7682
diff
changeset
|
247 |
offset := start. |
9c2cd42e4667
Provide a #nextBytes:into:startingAt: that does not block the whole ST/X
Stefan Vogel <sv@exept.de>
parents:
7682
diff
changeset
|
248 |
|
10327 | 249 |
[ |
250 |
nRead := self nextAvailableBytes:remaining into:anObject startingAt:offset. |
|
251 |
nRead == 0 ifTrue:[ |
|
252 |
"atEnd does a readWait" |
|
253 |
self atEnd not. |
|
254 |
] ifFalse:[ |
|
255 |
remaining := remaining - nRead. |
|
256 |
offset := offset + nRead. |
|
257 |
remaining ~~ 0. |
|
258 |
] |
|
7861
9c2cd42e4667
Provide a #nextBytes:into:startingAt: that does not block the whole ST/X
Stefan Vogel <sv@exept.de>
parents:
7682
diff
changeset
|
259 |
] whileTrue. |
9c2cd42e4667
Provide a #nextBytes:into:startingAt: that does not block the whole ST/X
Stefan Vogel <sv@exept.de>
parents:
7682
diff
changeset
|
260 |
|
9c2cd42e4667
Provide a #nextBytes:into:startingAt: that does not block the whole ST/X
Stefan Vogel <sv@exept.de>
parents:
7682
diff
changeset
|
261 |
^ count - remaining |
9c2cd42e4667
Provide a #nextBytes:into:startingAt: that does not block the whole ST/X
Stefan Vogel <sv@exept.de>
parents:
7682
diff
changeset
|
262 |
! ! |
9c2cd42e4667
Provide a #nextBytes:into:startingAt: that does not block the whole ST/X
Stefan Vogel <sv@exept.de>
parents:
7682
diff
changeset
|
263 |
|
613 | 264 |
!NonPositionableExternalStream methodsFor:'positioning'! |
265 |
||
266 |
position |
|
2965 | 267 |
"{ Pragma: +optSpace }" |
268 |
||
613 | 269 |
"catch position - there is none here" |
270 |
||
271 |
^ self positionError |
|
1 | 272 |
! |
273 |
||
613 | 274 |
position:aPosition |
2965 | 275 |
"{ Pragma: +optSpace }" |
276 |
||
613 | 277 |
"catch position - there is none here" |
278 |
||
279 |
^ self positionError |
|
280 |
! |
|
44 | 281 |
|
613 | 282 |
skip:numberToSkip |
7241 | 283 |
"skip count bytes/characters, return the receiver. |
284 |
Re-redefined since PositionableStream redefined it." |
|
613 | 285 |
|
16207
923f92b4f0e8
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
16187
diff
changeset
|
286 |
"don't know how to unread ..." |
613 | 287 |
numberToSkip < 0 ifTrue:[ |
16348 | 288 |
PositionError raiseRequest. |
289 |
^ self |
|
88 | 290 |
]. |
16207
923f92b4f0e8
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
16187
diff
changeset
|
291 |
numberToSkip timesRepeat:[self next]. |
4467 | 292 |
|
293 |
"Modified: / 30.7.1999 / 12:42:12 / cg" |
|
1 | 294 |
! ! |
295 |
||
177 | 296 |
!NonPositionableExternalStream methodsFor:'printing & storing'! |
297 |
||
298 |
printOn:aStream |
|
2965 | 299 |
"{ Pragma: +optSpace }" |
300 |
||
4392 | 301 |
"append a user printed representation of the receiver to aStream. |
302 |
The format is suitable for a human - not meant to be read back." |
|
177 | 303 |
|
2965 | 304 |
|myName| |
305 |
||
177 | 306 |
self == Stdin ifTrue:[ |
10327 | 307 |
myName := 'Stdin'. |
2965 | 308 |
] ifFalse:[ |
10327 | 309 |
self == Stdout ifTrue:[ |
310 |
myName := 'Stdout'. |
|
311 |
] ifFalse:[ |
|
312 |
self == Stderr ifTrue:[ |
|
313 |
myName := 'Stderr'. |
|
314 |
] |
|
315 |
] |
|
177 | 316 |
]. |
2965 | 317 |
|
318 |
myName notNil ifTrue:[ |
|
10327 | 319 |
aStream nextPutAll:myName. |
320 |
^ self |
|
177 | 321 |
]. |
322 |
super printOn:aStream |
|
323 |
! |
|
324 |
||
325 |
storeOn:aStream |
|
2965 | 326 |
"{ Pragma: +optSpace }" |
327 |
||
213 | 328 |
"append a printed representation of the receiver on aStream, from |
329 |
which the receiver can be reconstructed." |
|
177 | 330 |
|
331 |
((self == Stdin) |
|
332 |
or:[self == Stdout |
|
333 |
or:[self == Stderr]]) ifTrue:[ |
|
334 |
^ self printOn:aStream |
|
335 |
]. |
|
336 |
super storeOn:aStream |
|
337 |
! ! |
|
338 |
||
613 | 339 |
!NonPositionableExternalStream methodsFor:'private'! |
360 | 340 |
|
5407 | 341 |
handleForStderr |
342 |
"{ Pragma: +optSpace }" |
|
343 |
||
344 |
"return a stderr handle" |
|
345 |
||
346 |
%{ |
|
10327 | 347 |
#ifdef WIN32 |
12677
aeab74b04f0b
Use __MKEXTERNALADDRESS() instead of __MKOBJ()
Stefan Vogel <sv@exept.de>
parents:
12395
diff
changeset
|
348 |
RETURN ( __MKEXTERNALADDRESS( __win32_stderr() )); |
10327 | 349 |
#else |
12677
aeab74b04f0b
Use __MKEXTERNALADDRESS() instead of __MKOBJ()
Stefan Vogel <sv@exept.de>
parents:
12395
diff
changeset
|
350 |
RETURN ( __MKEXTERNALADDRESS(stderr) ); |
10327 | 351 |
#endif |
5407 | 352 |
%} |
353 |
! |
|
354 |
||
355 |
handleForStdin |
|
356 |
"{ Pragma: +optSpace }" |
|
357 |
||
358 |
"return a stdin handle" |
|
359 |
||
360 |
%{ |
|
10327 | 361 |
#ifdef WIN32 |
12677
aeab74b04f0b
Use __MKEXTERNALADDRESS() instead of __MKOBJ()
Stefan Vogel <sv@exept.de>
parents:
12395
diff
changeset
|
362 |
RETURN ( __MKEXTERNALADDRESS( __win32_stdin() )); |
10327 | 363 |
#else |
12677
aeab74b04f0b
Use __MKEXTERNALADDRESS() instead of __MKOBJ()
Stefan Vogel <sv@exept.de>
parents:
12395
diff
changeset
|
364 |
RETURN ( __MKEXTERNALADDRESS(stdin) ); |
10327 | 365 |
#endif |
5407 | 366 |
%} |
367 |
! |
|
368 |
||
369 |
handleForStdout |
|
370 |
"{ Pragma: +optSpace }" |
|
371 |
||
372 |
"return a stdout handle" |
|
373 |
||
374 |
%{ |
|
10327 | 375 |
#ifdef WIN32 |
12677
aeab74b04f0b
Use __MKEXTERNALADDRESS() instead of __MKOBJ()
Stefan Vogel <sv@exept.de>
parents:
12395
diff
changeset
|
376 |
RETURN ( __MKEXTERNALADDRESS( __win32_stdout() )); |
10327 | 377 |
#else |
12677
aeab74b04f0b
Use __MKEXTERNALADDRESS() instead of __MKOBJ()
Stefan Vogel <sv@exept.de>
parents:
12395
diff
changeset
|
378 |
RETURN ( __MKEXTERNALADDRESS(stdout) ); |
10327 | 379 |
#endif |
5407 | 380 |
%} |
381 |
! |
|
382 |
||
613 | 383 |
initializeForStderr |
2965 | 384 |
"{ Pragma: +optSpace }" |
385 |
||
613 | 386 |
"setup for writing to stderr" |
269 | 387 |
|
613 | 388 |
mode := #readwrite. |
389 |
buffered := false. |
|
12395
1db7ea277c93
filePointer -> handle migration
Claus Gittinger <cg@exept.de>
parents:
11907
diff
changeset
|
390 |
handle := self handleForStderr. |
12754 | 391 |
handleType := #filePointer. |
5407 | 392 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
16348 | 393 |
eolMode := #crlf |
5407 | 394 |
] |
613 | 395 |
! |
1 | 396 |
|
397 |
initializeForStdin |
|
2965 | 398 |
"{ Pragma: +optSpace }" |
399 |
||
44 | 400 |
"setup for reading stdin" |
401 |
||
1 | 402 |
mode := #readonly. |
6843
ef53f65b7364
stdout/err must not be buffered (sending prompts without NL)
Claus Gittinger <cg@exept.de>
parents:
5918
diff
changeset
|
403 |
"/ buffered := true. |
ef53f65b7364
stdout/err must not be buffered (sending prompts without NL)
Claus Gittinger <cg@exept.de>
parents:
5918
diff
changeset
|
404 |
buffered := false. |
12754 | 405 |
handleType := #filePointer. |
12395
1db7ea277c93
filePointer -> handle migration
Claus Gittinger <cg@exept.de>
parents:
11907
diff
changeset
|
406 |
handle := self handleForStdin. |
1 | 407 |
! |
408 |
||
409 |
initializeForStdout |
|
2965 | 410 |
"{ Pragma: +optSpace }" |
411 |
||
44 | 412 |
"setup for writing to stdout" |
413 |
||
1 | 414 |
mode := #readwrite. |
10 | 415 |
buffered := false. |
12395
1db7ea277c93
filePointer -> handle migration
Claus Gittinger <cg@exept.de>
parents:
11907
diff
changeset
|
416 |
handle := self handleForStdout. |
12754 | 417 |
handleType := #filePointer. |
5407 | 418 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
16348 | 419 |
eolMode := #crlf |
5407 | 420 |
] |
1 | 421 |
! |
422 |
||
423 |
reOpen |
|
2965 | 424 |
"{ Pragma: +optSpace }" |
425 |
||
44 | 426 |
"reopen the stream after an image restart. |
427 |
If I am one of the standard streams, reopen is easy" |
|
1 | 428 |
|
477
8710aba7876b
oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents:
475
diff
changeset
|
429 |
(self == StdInStream) ifTrue:[ |
177 | 430 |
^ self initializeForStdin |
1 | 431 |
]. |
477
8710aba7876b
oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents:
475
diff
changeset
|
432 |
(self == StdOutStream) ifTrue:[ |
177 | 433 |
^ self initializeForStdout |
1 | 434 |
]. |
477
8710aba7876b
oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents:
475
diff
changeset
|
435 |
(self == StdErrorStream) ifTrue:[ |
177 | 436 |
^ self initializeForStderr |
1 | 437 |
]. |
438 |
^ super reOpen |
|
439 |
! ! |
|
613 | 440 |
|
441 |
!NonPositionableExternalStream methodsFor:'queries'! |
|
442 |
||
5851
6823cc642d60
only do readWait for pipes and sockets.
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
443 |
atEnd |
6823cc642d60
only do readWait for pipes and sockets.
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
444 |
"return true, if position is at end" |
6823cc642d60
only do readWait for pipes and sockets.
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
445 |
|
5918 | 446 |
(self == StdInStream) ifTrue:[ |
447 |
OperatingSystem hasConsole ifFalse:[ |
|
448 |
^ true |
|
449 |
] |
|
450 |
]. |
|
451 |
||
5851
6823cc642d60
only do readWait for pipes and sockets.
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
452 |
"first, wait to avoid blocking on the read. |
6823cc642d60
only do readWait for pipes and sockets.
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
453 |
On end of stream or error, readWait will return" |
6823cc642d60
only do readWait for pipes and sockets.
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
454 |
|
6823cc642d60
only do readWait for pipes and sockets.
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
455 |
self readWait. |
6823cc642d60
only do readWait for pipes and sockets.
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
456 |
^ super atEnd. |
6823cc642d60
only do readWait for pipes and sockets.
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
457 |
! |
6823cc642d60
only do readWait for pipes and sockets.
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
458 |
|
5407 | 459 |
isPositionable |
460 |
"return true, if the stream supports positioning (this one is not)" |
|
461 |
||
462 |
^ false |
|
11455 | 463 |
! |
464 |
||
12395
1db7ea277c93
filePointer -> handle migration
Claus Gittinger <cg@exept.de>
parents:
11907
diff
changeset
|
465 |
size |
11455 | 466 |
"we do not know our size" |
467 |
||
468 |
^ self positionError |
|
613 | 469 |
! ! |
470 |
||
10349
cbfa00bba11d
Speedup ExternalStream>>#nextOrNil and ExternalStream>>#peekOrNil.
Stefan Vogel <sv@exept.de>
parents:
10327
diff
changeset
|
471 |
!NonPositionableExternalStream methodsFor:'reading'! |
cbfa00bba11d
Speedup ExternalStream>>#nextOrNil and ExternalStream>>#peekOrNil.
Stefan Vogel <sv@exept.de>
parents:
10327
diff
changeset
|
472 |
|
14758
6a70a7006093
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
12754
diff
changeset
|
473 |
next |
6a70a7006093
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
12754
diff
changeset
|
474 |
"return the next element, if available. |
6a70a7006093
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
12754
diff
changeset
|
475 |
If nothing is available, this does never raise a read-beyond end signal. |
6a70a7006093
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
12754
diff
changeset
|
476 |
Instead, nil is returned immediately. |
6a70a7006093
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
12754
diff
changeset
|
477 |
|
6a70a7006093
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
12754
diff
changeset
|
478 |
Redefined, to wait on pipes and sockets" |
6a70a7006093
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
12754
diff
changeset
|
479 |
|
6a70a7006093
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
12754
diff
changeset
|
480 |
self readWait. |
6a70a7006093
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
12754
diff
changeset
|
481 |
^ super next |
6a70a7006093
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
12754
diff
changeset
|
482 |
! |
6a70a7006093
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
12754
diff
changeset
|
483 |
|
15796
b3fdd3c2aec2
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
15720
diff
changeset
|
484 |
nextLine |
b3fdd3c2aec2
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
15720
diff
changeset
|
485 |
"Redefined, to wait on pipes and sockets" |
b3fdd3c2aec2
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
15720
diff
changeset
|
486 |
|
b3fdd3c2aec2
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
15720
diff
changeset
|
487 |
self readWait. |
b3fdd3c2aec2
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
15720
diff
changeset
|
488 |
^ super nextLine |
b3fdd3c2aec2
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
15720
diff
changeset
|
489 |
! |
b3fdd3c2aec2
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
15720
diff
changeset
|
490 |
|
10349
cbfa00bba11d
Speedup ExternalStream>>#nextOrNil and ExternalStream>>#peekOrNil.
Stefan Vogel <sv@exept.de>
parents:
10327
diff
changeset
|
491 |
nextOrNil |
cbfa00bba11d
Speedup ExternalStream>>#nextOrNil and ExternalStream>>#peekOrNil.
Stefan Vogel <sv@exept.de>
parents:
10327
diff
changeset
|
492 |
"like #next, this returns the next element, if available. |
cbfa00bba11d
Speedup ExternalStream>>#nextOrNil and ExternalStream>>#peekOrNil.
Stefan Vogel <sv@exept.de>
parents:
10327
diff
changeset
|
493 |
If nothing is available, this does never raise a read-beyond end signal. |
cbfa00bba11d
Speedup ExternalStream>>#nextOrNil and ExternalStream>>#peekOrNil.
Stefan Vogel <sv@exept.de>
parents:
10327
diff
changeset
|
494 |
Instead, nil is returned immediately. |
cbfa00bba11d
Speedup ExternalStream>>#nextOrNil and ExternalStream>>#peekOrNil.
Stefan Vogel <sv@exept.de>
parents:
10327
diff
changeset
|
495 |
|
cbfa00bba11d
Speedup ExternalStream>>#nextOrNil and ExternalStream>>#peekOrNil.
Stefan Vogel <sv@exept.de>
parents:
10327
diff
changeset
|
496 |
Redefined, to wait on pipes and sockets" |
cbfa00bba11d
Speedup ExternalStream>>#nextOrNil and ExternalStream>>#peekOrNil.
Stefan Vogel <sv@exept.de>
parents:
10327
diff
changeset
|
497 |
|
cbfa00bba11d
Speedup ExternalStream>>#nextOrNil and ExternalStream>>#peekOrNil.
Stefan Vogel <sv@exept.de>
parents:
10327
diff
changeset
|
498 |
self atEnd ifTrue:[^ nil]. |
14758
6a70a7006093
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
12754
diff
changeset
|
499 |
^ super nextOrNil |
6a70a7006093
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
12754
diff
changeset
|
500 |
! |
6a70a7006093
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
12754
diff
changeset
|
501 |
|
6a70a7006093
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
12754
diff
changeset
|
502 |
peek |
6a70a7006093
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
12754
diff
changeset
|
503 |
"Redefined, to wait on pipes and sockets" |
6a70a7006093
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
12754
diff
changeset
|
504 |
|
6a70a7006093
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
12754
diff
changeset
|
505 |
self readWait. |
6a70a7006093
class: NonPositionableExternalStream
Stefan Vogel <sv@exept.de>
parents:
12754
diff
changeset
|
506 |
^ super peek |
10349
cbfa00bba11d
Speedup ExternalStream>>#nextOrNil and ExternalStream>>#peekOrNil.
Stefan Vogel <sv@exept.de>
parents:
10327
diff
changeset
|
507 |
! |
cbfa00bba11d
Speedup ExternalStream>>#nextOrNil and ExternalStream>>#peekOrNil.
Stefan Vogel <sv@exept.de>
parents:
10327
diff
changeset
|
508 |
|
cbfa00bba11d
Speedup ExternalStream>>#nextOrNil and ExternalStream>>#peekOrNil.
Stefan Vogel <sv@exept.de>
parents:
10327
diff
changeset
|
509 |
peekOrNil |
cbfa00bba11d
Speedup ExternalStream>>#nextOrNil and ExternalStream>>#peekOrNil.
Stefan Vogel <sv@exept.de>
parents:
10327
diff
changeset
|
510 |
"like #peek, this returns the next element, if available. |
cbfa00bba11d
Speedup ExternalStream>>#nextOrNil and ExternalStream>>#peekOrNil.
Stefan Vogel <sv@exept.de>
parents:
10327
diff
changeset
|
511 |
If nothing is available, this does never raise a read-beyond end signal. |
cbfa00bba11d
Speedup ExternalStream>>#nextOrNil and ExternalStream>>#peekOrNil.
Stefan Vogel <sv@exept.de>
parents:
10327
diff
changeset
|
512 |
Instead, nil is returned immediately. |
cbfa00bba11d
Speedup ExternalStream>>#nextOrNil and ExternalStream>>#peekOrNil.
Stefan Vogel <sv@exept.de>
parents:
10327
diff
changeset
|
513 |
|
cbfa00bba11d
Speedup ExternalStream>>#nextOrNil and ExternalStream>>#peekOrNil.
Stefan Vogel <sv@exept.de>
parents:
10327
diff
changeset
|
514 |
Redefined, to wait on pipes and sockets" |
cbfa00bba11d
Speedup ExternalStream>>#nextOrNil and ExternalStream>>#peekOrNil.
Stefan Vogel <sv@exept.de>
parents:
10327
diff
changeset
|
515 |
|
cbfa00bba11d
Speedup ExternalStream>>#nextOrNil and ExternalStream>>#peekOrNil.
Stefan Vogel <sv@exept.de>
parents:
10327
diff
changeset
|
516 |
self atEnd ifTrue:[^ nil]. |
cbfa00bba11d
Speedup ExternalStream>>#nextOrNil and ExternalStream>>#peekOrNil.
Stefan Vogel <sv@exept.de>
parents:
10327
diff
changeset
|
517 |
^ self peek |
cbfa00bba11d
Speedup ExternalStream>>#nextOrNil and ExternalStream>>#peekOrNil.
Stefan Vogel <sv@exept.de>
parents:
10327
diff
changeset
|
518 |
! ! |
cbfa00bba11d
Speedup ExternalStream>>#nextOrNil and ExternalStream>>#peekOrNil.
Stefan Vogel <sv@exept.de>
parents:
10327
diff
changeset
|
519 |
|
7497
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
520 |
!NonPositionableExternalStream methodsFor:'writing'! |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
521 |
|
7679 | 522 |
nextPutBytes:initialWriteCount from:buffer startingAt:initialOffset |
523 |
"redefined, to wait until stream is writable, to avoid blocking in a write" |
|
7497
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
524 |
|
7682
5d43745f59ac
only do a writeWait if previous non-blocking write failed to
Claus Gittinger <cg@exept.de>
parents:
7679
diff
changeset
|
525 |
|count offset remaining wasBlocking| |
7497
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
526 |
|
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
527 |
offset := initialOffset. |
7679 | 528 |
remaining := initialWriteCount. |
7497
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
529 |
|
7679 | 530 |
wasBlocking := self blocking:false. |
10327 | 531 |
[remaining ~~ 0] whileTrue:[ |
16348 | 532 |
count := super nextPutBytes:remaining from:buffer startingAt:offset. |
533 |
count ~~ remaining ifTrue:[ "Transcript showCR:'writeWait'. "self writeWait. ]. |
|
7682
5d43745f59ac
only do a writeWait if previous non-blocking write failed to
Claus Gittinger <cg@exept.de>
parents:
7679
diff
changeset
|
534 |
|
16348 | 535 |
remaining := remaining - count. |
536 |
offset := offset + count. |
|
7497
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
537 |
]. |
7679 | 538 |
wasBlocking ifTrue:[self blocking:true]. |
539 |
||
7497
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
540 |
^ offset - initialOffset. |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
541 |
! ! |
cc29afd51151
Do not block when writing to pipes
Stefan Vogel <sv@exept.de>
parents:
7241
diff
changeset
|
542 |
|
1295 | 543 |
!NonPositionableExternalStream class methodsFor:'documentation'! |
544 |
||
545 |
version |
|
16348 | 546 |
^ '$Header: /cvs/stx/stx/libbasic/NonPositionableExternalStream.st,v 1.71 2014-04-16 14:33:08 stefan Exp $' |
12677
aeab74b04f0b
Use __MKEXTERNALADDRESS() instead of __MKOBJ()
Stefan Vogel <sv@exept.de>
parents:
12395
diff
changeset
|
547 |
! |
aeab74b04f0b
Use __MKEXTERNALADDRESS() instead of __MKOBJ()
Stefan Vogel <sv@exept.de>
parents:
12395
diff
changeset
|
548 |
|
aeab74b04f0b
Use __MKEXTERNALADDRESS() instead of __MKOBJ()
Stefan Vogel <sv@exept.de>
parents:
12395
diff
changeset
|
549 |
version_CVS |
16348 | 550 |
^ '$Header: /cvs/stx/stx/libbasic/NonPositionableExternalStream.st,v 1.71 2014-04-16 14:33:08 stefan Exp $' |
1295 | 551 |
! ! |