Re: Re: proc_open, fwrite, 16384 bytes magic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> In this case are you sure that the file is being sent via proc_open()? can
> you provide a simplified script that does this?

Sure, here's a test script, the output from it, and a few words on the email I 
receive:
<?php
  $descriptorspec = array(
    0 => array("pipe", "r"),
    1 => array("pipe", "w"),
    2 => array("file", "/tmp/error-output.txt", "a")
  );
  $text = "";
  for ($i=0; $i<10240; $i++) $text.="1";
  $text.="END\n";
  $doccmd = "/usr/bin/qmail-inject";
  $res = proc_open ($doccmd, $descriptorspec, $pipes);
  fwrite ($pipes[0], "TO: somemailaddress@xxxxxxxxx\n\n");
  echo fwrite ($pipes[0], $text)."\n";
  echo fwrite ($pipes[0], $text)."\n";
  fclose ($pipes[0]);
?>

  The output is: 
10244
6109

  Now, that's not counting the first TO: plus two \n's. Altogether it always 
sums up to 16384 bytes.

  In the email I receive, it honestly shows exactly the amount of data 
fwrite() claimed to have written, and not a symbol more.

  Any ideas?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux