2008/8/29 Bert Freudenberg bert@freudenbergs.de:
I have implemented direct support for std streams:
http://squeakvm.org/svn/squeak/branches/olpc/platforms/Cross/plugins/FilePlu...
This will catch filenames like "/dev/stderr" and connect the real stderr instead (also preventing to close these).
This file pattern is in usage already, e.g.
http://lists.squeakfoundation.org/pipermail/beginners/2007-April/002268.html
In OLPC we used this to log errors (we added FileStream class>>stderr etc.) because SqueakDebug.log is in an unaccessible place, but using the /dev/stderr symlink is broken by the security architecture, so I need to access the actual stderr.
Any objections to make this go into the trunk Cross platform dir?
yes. In windows you can't open '/dev/stderr' but you can open it if you using an stdio library. like fopen(...)
In libc they are defined as a 'well-known' file handles = 0,1,2 which is stand for stdin, stdout and stderr correspondingly.
And i'm completely with you. Squeak should have support for standard input/output streams.
- Bert -