[Pharo-project] Using stdout in Windows --> 'File stdout is closed'
Hi In my windows 7, I get an error when trying to write to "FileStream stdout" in both Pharo 1.4 and 1.3 (revisions #14423 and #13320). To reproduce, - download: https://ci.lille.inria.fr/pharo/job/Pharo%201.4/373/artifact/Pharo-1.4.zip - evaluate: FileStream stdout nextPutAll: 'a'. Is this a known issue? I couldn't find it in issue tracker. Thanks in advance. MartÃn
Can you check with squeak? Because we took stout from levente's work and I do not see why it would not work. Did you try with the latest VM? also the one of eliot? Because may be there is a primitive problem. Stef On Apr 9, 2012, at 1:31 AM, Martin Dias wrote:
Hi
In my windows 7, I get an error when trying to write to "FileStream stdout" in both Pharo 1.4 and 1.3 (revisions #14423 and #13320).
To reproduce,
- download: https://ci.lille.inria.fr/pharo/job/Pharo%201.4/373/artifact/Pharo-1.4.zip
- evaluate: FileStream stdout nextPutAll: 'a'.
Is this a known issue? I couldn't find it in issue tracker.
Thanks in advance. MartÃn <PharoDebug.log>
Hi Martin, I get the same thing if I start Cog with no special command line, and I think this seems kind of correct to me, as I'm not sure where the output would go when there is no console attached. C:\foo> CogVM.exe test.image If I start Cog with output redirected to a file, then "FileStream stdout" seems to work as expected: C:\foo> CogVM.exe test.image >file Stuff written to "FileStream stdout" now appears in "file". Using cygwin, I can pipe through "cat" to get the output on the terminal: $ ./CogVM.exe test.image | cat Cheers, Martin On Mon, Apr 9, 2012 at 9:01 AM, Martin Dias <tinchodias@gmail.com> wrote:
Hi
In my windows 7, I get an error when trying to write to "FileStream stdout" in both Pharo 1.4 and 1.3 (revisions #14423 and #13320).
To reproduce,
- download: https://ci.lille.inria.fr/pharo/job/Pharo%201.4/373/artifact/Pharo-1.4.zip
- evaluate: FileStream stdout nextPutAll: 'a'.
Is this a known issue? I couldn't find it in issue tracker.
Thanks in advance. MartÃn
Hi: On 10 Apr 2012, at 02:58, Martin Sandiford wrote:
I get the same thing if I start Cog with no special command line, and I think this seems kind of correct to me, as I'm not sure where the output would go when there is no console attached.
C:\foo> CogVM.exe test.image
This works on unix/OSX, the stdout should just be the command line. Strange that it seems to work for you when you do a redirect. Would guess that is a problem in the platform dependent code of the FilePlugin. Best regards Stefan -- Stefan Marr Software Languages Lab Vrije Universiteit Brussel Pleinlaan 2 / B-1050 Brussels / Belgium http://soft.vub.ac.be/~smarr Phone: +32 2 629 2974 Fax: +32 2 629 3525
Hi Stefan, I'm don't think that Windows GUI apps get a functioning stdout handle from the OS unless redirected. Martin On Tue, Apr 10, 2012 at 6:08 PM, Stefan Marr <smalltalk@stefan-marr.de> wrote:
Hi:
On 10 Apr 2012, at 02:58, Martin Sandiford wrote:
I get the same thing if I start Cog with no special command line, and I think this seems kind of correct to me, as I'm not sure where the output would go when there is no console attached.
  C:\foo> CogVM.exe test.image
This works on unix/OSX, the stdout should just be the command line. Strange that it seems to work for you when you do a redirect.
Would guess that is a problem in the platform dependent code of the FilePlugin.
On Tue, Apr 10, 2012 at 5:38 AM, Stefan Marr <smalltalk@stefan-marr.de>wrote:
Hi:
On 10 Apr 2012, at 02:58, Martin Sandiford wrote:
I get the same thing if I start Cog with no special command line, and I think this seems kind of correct to me, as I'm not sure where the output would go when there is no console attached.
C:\foo> CogVM.exe test.image
This works on unix/OSX, the stdout should just be the command line. Strange that it seems to work for you when you do a redirect.
Yes! that was I expected. Anyway Martin's answer helped me, and discovered that: C:\foo> CogVM.exe test.image | more is ok for me. What I also didn't expect is that when running "-headless", still a window is opened. I read something about evaluating "UIManager default nonInteractiveManager" but I couldn't achieve to do so yet. Thanks!
Would guess that is a problem in the platform dependent code of the FilePlugin.
Best regards Stefan
-- Stefan Marr Software Languages Lab Vrije Universiteit Brussel Pleinlaan 2 / B-1050 Brussels / Belgium http://soft.vub.ac.be/~smarr Phone: +32 2 629 2974 Fax: +32 2 629 3525
On 9 April 2012 01:31, Martin Dias <tinchodias@gmail.com> wrote:
Hi
In my windows 7, I get an error when trying to write to "FileStream stdout" in both Pharo 1.4 and 1.3 (revisions #14423 and #13320).
To reproduce,
- download: https://ci.lille.inria.fr/pharo/job/Pharo%201.4/373/artifact/Pharo-1.4.zip
- evaluate: FileStream stdout nextPutAll: 'a'.
Is this a known issue? I couldn't find it in issue tracker.
this is known issue. im not sure if i added it to tracker.
Thanks in advance. MartÃn
-- Best regards, Igor Stasenko.
Hi Martin, would you please try with both the Croquet.exe and the CroquetConsole.exe in http://www.mirandabanda.org/files/Cog/VM/VM.r2540/cogwin.zip?. The CroquetConsole.exe is designed to be used from the command line; stupidly Windows has this distinction between console apps and windows apps, and this distinction affects standard i/o. If CroquetCOnsole works then the implication is that Pharo needs also to build both VMs and the user needs to select the console VM for console use and the Windows VM for detatched use. HTH Eliot On Sun, Apr 8, 2012 at 4:31 PM, Martin Dias <tinchodias@gmail.com> wrote:
Hi
In my windows 7, I get an error when trying to write to "FileStream stdout" in both Pharo 1.4 and 1.3 (revisions #14423 and #13320).
To reproduce,
- download: https://ci.lille.inria.fr/pharo/job/Pharo%201.4/373/artifact/Pharo-1.4.zip
- evaluate: FileStream stdout nextPutAll: 'a'.
Is this a known issue? I couldn't find it in issue tracker.
Thanks in advance. MartÃn
-- best, Eliot
On Tue, Apr 10, 2012 at 1:45 PM, Eliot Miranda <eliot.miranda@gmail.com>wrote:
Hi Martin,
would you please try with both the Croquet.exe and the CroquetConsole.exe in http://www.mirandabanda.org/files/Cog/VM/VM.r2540/cogwin.zip?. The CroquetConsole.exe is designed to be used from the command line; stupidly Windows has this distinction between console apps and windows apps, and this distinction affects standard i/o. If CroquetCOnsole works then the implication is that Pharo needs also to build both VMs and the user needs to select the console VM for console use and the Windows VM for detatched use.
Oh, thanks, using CroquetConsole.exe it works fine. Now, I realized that in DOS #cr does not work fine as "new line" so I changed to #crlf... this was necessary also using cygwin and another bash emulator. But... hmmm... use a special vm + use a different newline character => I prefer to avoid that, just using the normal cogvm and redirect to a file using ">" in command-line. Thank you very much!
HTH Eliot
On Sun, Apr 8, 2012 at 4:31 PM, Martin Dias <tinchodias@gmail.com> wrote:
Hi
In my windows 7, I get an error when trying to write to "FileStream stdout" in both Pharo 1.4 and 1.3 (revisions #14423 and #13320).
To reproduce,
- download: https://ci.lille.inria.fr/pharo/job/Pharo%201.4/373/artifact/Pharo-1.4.zip
- evaluate: FileStream stdout nextPutAll: 'a'.
Is this a known issue? I couldn't find it in issue tracker.
Thanks in advance. MartÃn
-- best, Eliot
On Tue, Apr 10, 2012 at 4:35 PM, Martin Dias <tinchodias@gmail.com> wrote:
On Tue, Apr 10, 2012 at 1:45 PM, Eliot Miranda <eliot.miranda@gmail.com>wrote:
Hi Martin,
would you please try with both the Croquet.exe and the CroquetConsole.exe in http://www.mirandabanda.org/files/Cog/VM/VM.r2540/cogwin.zip?. The CroquetConsole.exe is designed to be used from the command line; stupidly Windows has this distinction between console apps and windows apps, and this distinction affects standard i/o. If CroquetCOnsole works then the implication is that Pharo needs also to build both VMs and the user needs to select the console VM for console use and the Windows VM for detatched use.
Oh, thanks, using CroquetConsole.exe it works fine.
Now, I realized that in DOS #cr does not work fine as "new line" so I changed to #crlf... this was necessary also using cygwin and another bash emulator.
But... hmmm...
use a special vm + use a different newline character
If you set its lineEndCOnvention correctly you shouldn't have to use a different character. The special VM is forced by WIndows (and if you compare the bits you'll see they differ in only a few bytes).
=> I prefer to avoid that, just using the normal cogvm and redirect to a file using ">" in command-line.
Thank you very much!
HTH Eliot
On Sun, Apr 8, 2012 at 4:31 PM, Martin Dias <tinchodias@gmail.com> wrote:
Hi
In my windows 7, I get an error when trying to write to "FileStream stdout" in both Pharo 1.4 and 1.3 (revisions #14423 and #13320).
To reproduce,
- download:
https://ci.lille.inria.fr/pharo/job/Pharo%201.4/373/artifact/Pharo-1.4.zip
- evaluate: FileStream stdout nextPutAll: 'a'.
Is this a known issue? I couldn't find it in issue tracker.
Thanks in advance. MartÃn
-- best, Eliot
-- best, Eliot
On Tue, Apr 10, 2012 at 8:41 PM, Eliot Miranda <eliot.miranda@gmail.com>wrote:
On Tue, Apr 10, 2012 at 4:35 PM, Martin Dias <tinchodias@gmail.com> wrote:
On Tue, Apr 10, 2012 at 1:45 PM, Eliot Miranda <eliot.miranda@gmail.com>wrote:
Hi Martin,
would you please try with both the Croquet.exe and the CroquetConsole.exe in http://www.mirandabanda.org/files/Cog/VM/VM.r2540/cogwin.zip?. The CroquetConsole.exe is designed to be used from the command line; stupidly Windows has this distinction between console apps and windows apps, and this distinction affects standard i/o. If CroquetCOnsole works then the implication is that Pharo needs also to build both VMs and the user needs to select the console VM for console use and the Windows VM for detatched use.
Oh, thanks, using CroquetConsole.exe it works fine.
Now, I realized that in DOS #cr does not work fine as "new line" so I changed to #crlf... this was necessary also using cygwin and another bash emulator.
But... hmmm...
use a special vm + use a different newline character
If you set its lineEndCOnvention correctly you shouldn't have to use a different character. The special VM is forced by WIndows (and if you compare the bits you'll see they differ in only a few bytes).
Ok, so I will take the two alternatives into account, and I will see what results better in the practice. PS: I also rejected #crlf because I saw that Transcript in Pharo (at least in 1.4 and 1.3) currently doesn't support it, so made me feel to better don't use it. But maybe makes sense to report the issue and implement it.
=> I prefer to avoid that, just using the normal cogvm and redirect to a file using ">" in command-line.
Thank you very much!
HTH Eliot
On Sun, Apr 8, 2012 at 4:31 PM, Martin Dias <tinchodias@gmail.com>wrote:
Hi
In my windows 7, I get an error when trying to write to "FileStream stdout" in both Pharo 1.4 and 1.3 (revisions #14423 and #13320).
To reproduce,
- download:
https://ci.lille.inria.fr/pharo/job/Pharo%201.4/373/artifact/Pharo-1.4.zip
- evaluate: FileStream stdout nextPutAll: 'a'.
Is this a known issue? I couldn't find it in issue tracker.
Thanks in advance. MartÃn
-- best, Eliot
-- best, Eliot
participants (6)
-
Eliot Miranda -
Igor Stasenko -
Martin Dias -
Martin Sandiford -
Stefan Marr -
Stéphane Ducasse