note 106242 added to function.disk-total-space
| From: | Anonymous at osu1 dot php dot net | Date: | Thu, 20 Oct 2011 23:03:10 +0000 |
| Subject: | note 106242 added to function.disk-total-space | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-184036@lists.php.net to get a copy of this message | ||
@ f.get_files()
I had to modify the "unix" portion of the get_files() sample function to get it to work on
my CentOS install. Minor change, but instead of parsing every token of mount's output as a big
string, it is broken into multiple lines, checks the first token for the "dev" check, and
the third token as the disk identifier:
[php]
// unix
$data =
/bin/mount;
$data = explode("\n", $data);
$disks = array();
foreach ($data as $line) {
$tokens = explode(' ', $line);
if (($dname = substr($tokens[0], 0, 5)) == '/dev/') $disks[] = $tokens[2];
}
[/php]
----
Server IP: 64.71.164.2
Probable Submitter: 173.8.145.37
----
Manual Page -- http://www.php.net/manual/en/function.disk-total-space.php
Edit -- https://master.php.net/note/edit/106242
Del: integrated -- https://master.php.net/note/delete/106242/integrated
Del: useless -- https://master.php.net/note/delete/106242/useless
Del: bad code -- https://master.php.net/note/delete/106242/bad+code
Del: spam -- https://master.php.net/note/delete/106242/spam
Del: non-english -- https://master.php.net/note/delete/106242/non-english
Del: in docs -- https://master.php.net/note/delete/106242/in+docs
Del: other reasons-- https://master.php.net/note/delete/106242
Reject -- https://master.php.net/note/reject/106242
Search -- https://master.php.net/manage/user-notes.php