'From etoys3.0 of 7 March 2008 [latest update: #2113] on 29 August 2008 at 2:38:53 pm'! "Change Set: robustStdStreams2-bf Date: 28 August 2008 Author: Bert Freudenberg Protect stdin, stdout, stderr against file open failure, and reopen if closed."! !FileStream class methodsFor: 'standard streams' stamp: 'bf 8/29/2008 14:37'! stderr SmalltalkImage current platformName = 'unix' ifFalse: [^nil]. (StdErr isNil or: [StdErr closed]) ifTrue: [ StdErr := MultiByteFileStream new open: '/dev/stderr' forWrite: true. StdErr ifNotNil: [StdErr lineEndConvention: #lf]]. ^StdErr! ! !FileStream class methodsFor: 'standard streams' stamp: 'bf 8/29/2008 14:37'! stdin SmalltalkImage current platformName = 'unix' ifFalse: [^nil]. (StdIn isNil or: [StdIn closed]) ifTrue: [ StdIn := MultiByteFileStream new open: '/dev/stdin' forWrite: false. StdIn ifNotNil: [StdIn lineEndConvention: #lf]]. ^StdIn! ! !FileStream class methodsFor: 'standard streams' stamp: 'bf 8/29/2008 14:36'! stdout SmalltalkImage current platformName = 'unix' ifFalse: [^nil]. (StdOut isNil or: [StdOut closed]) ifTrue: [ StdOut := MultiByteFileStream new open: '/dev/stdout' forWrite: true. StdOut ifNotNil: [StdOut lineEndConvention: #lf]]. ^StdOut! !