FileStream stdout closed?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

FileStream stdout closed?

fniephaus
Hi all,

`FileStream stdout closed` returns `true`. Is there a specific reason for this or is it a bug?

Cheers,
Fabio


Reply | Threaded
Open this post in threaded view
|

Re: FileStream stdout closed?

David T. Lewis
It's a bug.

It may be more of a conceptual bug than a code error. The "size" of
the stdout file stream is not knowable, so the file size test in
StandardFileStream>>closed does not really make sense in the context
of an output stream that typically is not attached to a file.

Having said that, I see this result with the classic interpreter VM
on an updated image (trunk level update but old V3 image format):

  OSProcess thisOSProcess stdOut closed ==> false
  FileStream stdout closed ==> true.

And with the current Cog/Spur on a similar level image:

  OSProcess thisOSProcess stdOut closed ==> true
  FileStream stdout closed ==> true

So at one time, the test worked correctly with OSProcess.

So maybe there is a way to have it work as expected with FileStream>>stdout
(and OSProcess again). I suspect the differences may be related to
VM changes in the SQFile data structure, but I have not checked to
confirm.

Dave


On Sun, Oct 13, 2019 at 02:52:26PM +0200, Fabio Niephaus wrote:
> Hi all,
>
> `FileStream stdout closed` returns `true`. Is there a specific reason for
> this or is it a bug?
>
> Cheers,
> Fabio

>


Reply | Threaded
Open this post in threaded view
|

Re: FileStream stdout closed?

fniephaus
On Mon, Oct 14, 2019 at 4:06 AM David T. Lewis <[hidden email]> wrote:
It's a bug.

It may be more of a conceptual bug than a code error. The "size" of
the stdout file stream is not knowable, so the file size test in
StandardFileStream>>closed does not really make sense in the context
of an output stream that typically is not attached to a file.

Having said that, I see this result with the classic interpreter VM
on an updated image (trunk level update but old V3 image format):

  OSProcess thisOSProcess stdOut closed ==> false
  FileStream stdout closed ==> true.

And with the current Cog/Spur on a similar level image:

  OSProcess thisOSProcess stdOut closed ==> true
  FileStream stdout closed ==> true

So at one time, the test worked correctly with OSProcess.

So maybe there is a way to have it work as expected with FileStream>>stdout
(and OSProcess again). I suspect the differences may be related to
VM changes in the SQFile data structure, but I have not checked to
confirm.

Thanks, Dave! I've opened an issue against OpenSmalltalkVM:

Fabio
 

Dave


On Sun, Oct 13, 2019 at 02:52:26PM +0200, Fabio Niephaus wrote:
> Hi all,
>
> `FileStream stdout closed` returns `true`. Is there a specific reason for
> this or is it a bug?
>
> Cheers,
> Fabio

>