Headless stdio and FileTranscript

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

Headless stdio and FileTranscript

Thomas Gagne-3
After a long hiatus I am returning to Smalltalk in an attempt to
resurrect some code from before the 2008 crash.

My main problem right now is getting a headless image to write to stderr.

Alan Knight answered a question I posted in 2007 that FileTranscript is
probably a good place to start, but that isn't documented well in the
AppDevGuide.  The guide actually recommends writing DLL/CC connectors
that will use the write() call.

So what is the ruling, do we use FileTranscript to write to handles or
do we write our own externals?

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Headless stdio and FileTranscript

Michael Lucas-Smith-2
The IO streams aren't exactly the same as files (cross platform), but what you're looking for is "almost" there.

You can use HeadlessImage current transcriptToStandardOut: true
to make the Transcript be a headless transcript that writes to stdout. Writing to stderr is a bit of an exceptional condition and there's no reason why you can't explicitly write to it yourself:

OS.Stderr nextPutAll: 'Hello World'; cr.

Cheers,
Michael

On 19/08/2013, at 4:02 PM, Thomas Gagne <[hidden email]> wrote:

> After a long hiatus I am returning to Smalltalk in an attempt to resurrect some code from before the 2008 crash.
>
> My main problem right now is getting a headless image to write to stderr.
>
> Alan Knight answered a question I posted in 2007 that FileTranscript is probably a good place to start, but that isn't documented well in the AppDevGuide.  The guide actually recommends writing DLL/CC connectors that will use the write() call.
>
> So what is the ruling, do we use FileTranscript to write to handles or do we write our own externals?
>
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Headless stdio and FileTranscript

Thomas Gagne-3
Is anyone else having a problem locating libc.so on contemporary Linux
platforms that support multi-archs?  On my Ubuntu build :

    tgagne@tgagne2:~$*locate libc.so*
    /lib/i386-linux-gnu/libc.so.6
    /usr/lib/i386-linux-gnu/libc.so

    tgagne@tgagne2:~$*uname -a*
    Linux tgagne2 3.2.0-48-generic #74-Ubuntu SMP Thu Jun 6 19:45:16 UTC
    2013 i686 i686 i386 GNU/Linux


On 8/19/2013 2:48 AM, Michael Lucas-Smith wrote:
> The IO streams aren't exactly the same as files (cross platform), but what you're looking for is "almost" there.
>
> You can use HeadlessImage current transcriptToStandardOut: true
> to make the Transcript be a headless transcript that writes to stdout. Writing to stderr is a bit of an exceptional condition and there's no reason why you can't explicitly write to it yourself:
>
> OS.Stderr nextPutAll: 'Hello World'; cr.
>
> Cheers,
> Michael

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Headless stdio and FileTranscript

Randy Coulman
Thomas,

This happens with other libraries as well (like libsqlite3).  I've filed a case with Cincom about it and last I heard, they're investigating and trying to come up with a fix.

For Sqlite3, I just created an override of the affected class definiition to add the correct architecture-specific library directory to the list of libraryDirectories.  Not ideal, but the best of the bad options available, IMO.

It'd be nice of libraryDirectories could be specified by pragmas like libraryFiles can be.

Randy

On Mon, Aug 19, 2013 at 11:49 AM, Thomas Gagne <[hidden email]> wrote:
Is anyone else having a problem locating libc.so on contemporary Linux platforms that support multi-archs?  On my Ubuntu build :

   tgagne@tgagne2:~$*locate libc.so*
   /lib/i386-linux-gnu/libc.so.6
   /usr/lib/i386-linux-gnu/libc.so

   tgagne@tgagne2:~$*uname -a*
   Linux tgagne2 3.2.0-48-generic #74-Ubuntu SMP Thu Jun 6 19:45:16 UTC
   2013 i686 i686 i386 GNU/Linux


On 8/19/2013 2:48 AM, Michael Lucas-Smith wrote:
The IO streams aren't exactly the same as files (cross platform), but what you're looking for is "almost" there.

You can use HeadlessImage current transcriptToStandardOut: true
to make the Transcript be a headless transcript that writes to stdout. Writing to stderr is a bit of an exceptional condition and there's no reason why you can't explicitly write to it yourself:

OS.Stderr nextPutAll: 'Hello World'; cr.

Cheers,
Michael

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc



--
Randy Coulman
Email: [hidden email]
Home: http://randycoulman.com
Twitter: @randycoulman      GitHub: randycoulman

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc