Re: Determining system resources

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

 



Greetings Robin,

As far as you cannot lock another processes in the system, so this will not give you the security that the resources will not change -and probably they'll do it- while you're trying to download that file.

Best regards,


Robin Getz wrote:

I have been unable to find a php function to determine available system
memory (physical and swap)?

Right now I am using something like:
=========
# ensure there is enough free memory for the download
$free = shell_exec('free -b'); $i=0; while ( $i != strlen($free) ) {
i = strlen($free);
free = str_replace(' ',' ',$free); }
$free = str_replace("\n",'',$free);
$freeArray = explode(' ',$free);
$total_free = $freeArray[9] + $freeArray[18];
==========


Does anyone have any ideas that could be used on all OSes? i.e. Without shell_exec()?

Thanks in advance.
-Robin


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