#40633 [Opn->Fbk]: disk_free_space returns a bad result on filesystems with negative free space

From: Date: Mon, 26 Feb 2007 09:33:42 +0000
Subject: #40633 [Opn->Fbk]: disk_free_space returns a bad result on filesystems with negative free space
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-109528@lists.php.net to get a copy of this message
ID: 40633 Updated by: tony2001@php.net Reported By: adam-phpbugs at adam dot gs -Status: Open +Status: Feedback Bug Type: Filesystem function related Operating System: *BSD (at least) PHP Version: 5.2.1 New Comment: What kind of BSD is that and don't you think that negative free space is a BSD bug? Previous Comments: ------------------------------------------------------------------------ [2007-02-26 00:55:02] adam-phpbugs at adam dot gs Description: ------------ on a filesystem with a negative amount of free space (this can happen on at least FreeBSD) disk_free_space returns unreasonable results. -=[/some/path]=- -=[Sun Feb 25]=- -=[19:51:55]=- [root@cube]# php -r 'print disk_free_space(".")."\n";' 3.77789318629E+22 -=[/some/path]=- -=[Sun Feb 25]=- -=[19:51:57]=- [root@cube]# df -h . Filesystem Size Used Avail Capacity Mounted on /dev/ad7 289G 289G -23G 109% /some/path -=[/some/path]=- -=[Sun Feb 25]=- -=[19:51:58]=- [root@cube]# df . Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/ad7 302732078 302699550 -24186038 109% /some/ path Reproduce code: --------------- php -r 'print disk_free_space(".")."\n";' Expected result: ---------------- -24186038 Actual result: -------------- 3.77789318629E+22 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=40633&edit=1

« previous php.bugs (#109528) next »