help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] sleep on stdin hang up gst


From: Dariusz Miśta
Subject: [Help-smalltalk] sleep on stdin hang up gst
Date: Fri, 5 Dec 2003 14:39:22 +0100 (CET)
User-agent: SquirrelMail/1.4.2

I'm begginer. I don't know if it's bug or my fault.
I want to use gst in pipe to do something but it hang up.
The simplest hang up program is:

In file hangup.st is 3 lines:
stdout nextPutAll: stdin nextLine; nl.
stdout nextPutAll: stdin nextLine; nl.
!

In command line i wrote:
$ (echo 'line1'; sleep 1; echo 'line2') | gst hangup.st

There must be sleep between this. Without it don't hang up.
The last message I found is in file buildins.st:

!FileDescriptor methodsFor: 'built ins'!
  fileOp: ioFuncIndex with: arg1 with: arg2
  "Private - Used to limit the number of primitives used by FileStreams"

  <primitive: VMpr_FileDescriptor_fileOp>
  " <-- we don't go there"
  file isNil ifTrue: [ SystemExceptions.FileError signal: 'file closed' ].
  File checkError.
  ^nil

and the previous is:

!FileDescriptor methodsFor: 'accessing'!

  ensureReadable
     "If the file is open, wait until data can be read from it.  The wait
     allows other Processes to run."
     | sem |
     self isPipe ifFalse: [ ^self ].
     self isOpen ifFalse: [ ^self ].
     sem  :=  Semaphore new.
     self fileOp: 14 with: 0 with: sem.
     " <-- we don't go there"
     self fileOp: 13 with: 0 ifFail: [ self close ].
! !

Now I use temporary file instead of use in pipe.

This is:

GNU Smalltalk version 2.1.5

on:

Red Hat Linux release 9 (Shrike)
Kernel 2.4.20-20.9 on an i686

What I must do to run it in a pipe.
Thanks for advice.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]