[Linux-programlama] Re: Merhaba.

---------

[Linux-programlama] Re: Merhaba.

From: Guychmyrat Amanmyradov <guychmyrat_at_yahoo.com.tr>
Date: Mon, 8 Oct 2007 17:45:58 +0300 (EEST)
Message-ID: <112846.99137.qm@web27015.mail.ukl.yahoo.com>

  Başkaları rahatsız olmasın diye özellikle sizin maile yazdım.
   
  Tama, bundan sonra gruba gönderirim.
   
   
  <?php
   
  echo exec("ffmpeg/ffmpeg -i komik.mpg komik.flv");
   
  ?>
   
   
  Şu kodu koşturduğum zaman, tıkanıp kalıyor. Hiçbir işlem yapmıyor.
   
  Araştırarak daha gelişmiş bir kod bulum oda şu :
   
   
   
   
   
  <?php
   
    runExternal( "C:\wamp\www\proje\ffmpeg -i komik.mpg komik.flv", &$code );
    
     if( $code )
       echo "bad transcoding";
     else
       echo "looks good";
   
  function runExternal( $cmd, &$code ) {
   
     $descriptorspec = array(
         0 => array("pipe", "r"), // stdin is a pipe that the child will read from
         1 => array("pipe", "w"), // stdout is a pipe that the child will write to
         2 => array("pipe", "w") // stderr is a file to write to
     );
   
     $pipes= array();
     $process = proc_open($cmd, $descriptorspec, $pipes);
   
     $output= "";
   
     if (!is_resource($process)){
              echo "falseeee";
              return false;
     }
     
   
   
     #close child's input imidiately
     fclose($pipes[0]);
   
     stream_set_blocking($pipes[1],false);
     stream_set_blocking($pipes[2],false);
   
     $todo= array($pipes[1],$pipes[2]);
   
     while( true ) {
         $read= array();
         if( !feof($pipes[1]) ) $read[]= $pipes[1];
         if( !feof($pipes[2]) ) $read[]= $pipes[2];
   
         if (!$read) break;
   
         $ready= stream_select($read, $write=NULL, $ex= NULL, 2);
   
         if ($ready === false) {
   
             break; #should never happen - something died
         }
   
         foreach ($read as $r) {
             $s= fread($r,1024);
             $output.= $s;
             echo "output : ".$output;
         }
     }
   
     fclose($pipes[1]);
     fclose($pipes[2]);
   
     $code= proc_close($process);
   
     return $output;
  }
   
  ?>
   
  Bu koda da şöyle hata veriyor :
   
  ‘C:\wamp\www' iç ya da dış komut, çalıştırılabilir program ya da toplu iç dosyası olarak tanınmıyor
  
       
---------------------------------
Yahoo! kullaniyor musunuz?
Istenmeyen postadan biktiniz mi? Istenmeyen postadan en iyi korunma Yahoo! Posta'da
http://tr.mail.yahoo.com

_______________________________________________
Linux-programlama mailing list
Linux-programlama_at_liste.linux.org.tr
http://liste.linux.org.tr/mailman/listinfo/linux-programlama
Received on Mon 08 Oct 2007 - 17:20:00 EEST

---------

Bu arsiv hypermail 2.2.0 tarafindan uretilmistir.