You are here: Re: shell_exec problem. « PHP Language « IT news, forums, messages
Re: shell_exec problem.

Posted by Senator Jay Billington Bulworth on 11/14/54 11:22

michelbh@gol.com (Michel Bouchet) wrote in news:42e5d181.3288859
@nnrp.gol.com:

> Hi,
>
> I am using the PHP shell_exec function like this :
>
> $TmpVar=shell_exec('du -sk /mnt/MyDevice/MyFolder/*');
>
> Even though I am supposed to get about ten lines, for some reason I
> ignore I only get one (one of the subfolders under MyFolder/ instead
> of all of them).

Look into using popen() and fgets() instead, this way you will get all of
the output. If the command you're running is going to output several
kilobytes of data, please keep this note..

http://php.net/manual/en/function.popen.php#50408

...in mind.

hth


--

Bulworth : PHP/MySQL/Unix | Email : str_rot13('f@fung.arg');
--------------------------|---------------------------------
<http://www.phplabs.com/> | PHP scripts, webmaster resources

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация