On Jun 7, 2006, at 5:25 PM, Stefan P. wrote:
A last non sarcastic question:
What does RB's Shell class call?
If I'd know what's going on, I'm happy to write some
C sample code and prove ME or YOU wrong.
Let's keep the hostility down a bit. REALbasic, on Mac OS X, currently
invokes /bin/sh with the "-c" option, passing in the user's input
afterwards. This is done after a fork if using Asynchronous or
Interactive mode. I'm not the engineer that wrote the code, but I
assume that the reason for having "sh" execute the command is simply
because it will setup a minimal environment to operate in and parse the
command given properly. It is very likely that any of the shells (which
we're using sh for no particular reason) will convert line endings such
that the terminals won't have to grok them. A way to verify that this
is happening is in the terminal to write:
/bin/sh -c "cat /foo/bar" > out.txt
Check to see if foo/bar and out.txt are the exact same. I'm guessing
that you'll notice that the line endings aren't the same anymore.
Now, as to what you can do about this:
a) Write out the results to a temporary file, and read it in from there
b) If you're using the shell in synchronous mode, consider calling
"exec" (or it's variants) directly. You could also do forking and
everything yourself, but it gets a bit trickier. This will allow you to
create the list of arguments as you see fit, and have nothing sitting
between you and stdin/stdout.
c) File a feature request for us to implement this differently, or a
separate set of classes that can be used to do process launching with
even more control (ie, direct access to stderr, stdin, stdout, etc)
I'm sure there's a few other options too.
HTH,
Jon
--
Jonathan Johnson
REAL Software, Inc.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>