Am 07.06.2006 um 23:27 schrieb [EMAIL PROTECTED]:

On Jun 07, 2006, at 19:55 UTC, Stefan P. wrote:

Thanks for this posting! I can confirm, that Shell() does filter/
translate the output.

No, you can only confirm that the combination of the Shell class, and the underlying Unix pipes and whatnot, do filter/translate the output. The Shell class itself is doing no such thing, but it is dependent on underlying system services. Unix pipes are generally intended for textual data (and many system calls make use of C strings, which can't contain nulls), so it doesn't shock me to hear evidence that they mangle binary data in some way.

This is definitely not true. The behaviour relies on the underlying system service -
the one the developer used in his source files.

And certainly, pipes pass ANY data, independent of intermitted zero- bytes. Zeroes at the 'incoming side' of a pipe just pass it through. If pipes were designed for something else, isn't relevant these days: Common use is to pass whatever from A to B.

This has basically nothing to do with null-delimited C-strings.

Proof me wrong and post a pointer to a verifiable source.

If your assumption, that RB doesn't change anything from the Shell() output,
this should be possible:
I should be able to exec() my command in a RB created (sub-)shell and
get anything as is from the yet replaced process image.
Right?

BTW: This C routine returns whatever is inside 'buynow20050412.gif' for example:

>>>
#include <stdio.h>
#include <stdlib.h>

void
write_data (FILE * stream)
{
  int i;
  for (i = 0; i < 100; i++)
    fprintf (stream, "%d\n", i);
  if (ferror (stream))
    {
      fprintf (stderr, "Output to stream failed.\n");
      exit (EXIT_FAILURE);
    }
}

int
main (void)
{
  FILE *output;

  output = popen ("cat buynow20050412.gif", "r");
  if (!output)
    {
      fprintf (stderr, "Could not run more.\n");
      return EXIT_FAILURE;
    }
  write_data (output);
  pclose (output);
  return EXIT_SUCCESS;
}
<<<

Pass it through a pipe, redirect the output - everything remains the same.


In my case, I used Shell to call PHP and return some binary data.
Since Shell doesn't return data transparently to the RB app, it's simply
useless for many cases.

Ah yes, the old "RB doesn't work exactly the way I think it should therefore it's useless" argument.

I wrote, that Shell is useless for/in many cases. I didn't write, what you cited.

Perhaps you should go program in C. Since C itself does almost nothing for you, you'll presumably have less to complain about. But no, wait, there's still the standard C library -- you'd no doubt want to use that, and then judge it useless because it doesn't do exactly what you want. So I recommend programming in assembly language, with no library or runtime framework whatsoever.

Thanks for the hints!

From this fun movie http://oodt.jpl.nasa.gov/better-web-app.mov :

        If you only have a hammer, everything seems to be nails ;-)




_______________________________________________
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>

Reply via email to