Bug #71542 [PATCH]: disk_total_space does not work with relative paths

From: Date: Mon, 16 Aug 2021 12:47:48 +0000
Subject: Bug #71542 [PATCH]: disk_total_space does not work with relative paths
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-235847@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71542&edit=1 ID: 71542 Patch added by: cmb@php.net Reported by: tonybogdanov at gmail dot com Summary: disk_total_space does not work with relative paths Status: Verified Type: Bug Package: Directory function related Operating System: * PHP Version: 7.3 ZTS Assigned To: cmb Block user comment: N Private report: N New Comment: The following pull request has been associated: Patch Name: Fix #71542: disk_total_space does not work with relative paths On GitHub: https://github.com/php/php-src/pull/7377 Patch: https://github.com/php/php-src/pull/7377.patch Previous Comments: ------------------------------------------------------------------------ [2020-04-01 11:27:34] cmb@php.net Thanks for the feedback. :) I had a closer look, and this issue is not Windows specific, but rather related to thread-safe (ZTS) builds on any OS. The problem is that disk_total_space() and disk_free_space() ignore the VCWD. ------------------------------------------------------------------------ [2020-04-01 08:22:33] tonybogdanov at gmail dot com I can't test this as I don't use Windows anymore, but it's been 4 years, I don't think anybody really cares anymore. ------------------------------------------------------------------------ [2020-03-31 13:57:38] cmb@php.net Does that still happen to you with any of the actively supported PHP versions[1]? [1] <php.net/supported-versions.php> ------------------------------------------------------------------------ [2016-02-07 12:54:46] tonybogdanov at gmail dot com Description: ------------ When run on Windows (WAMP) with Apache (using PHP alone in a console is fine), the function disk_total_space() throws Warning: disk_total_space(): The system cannot find the path specified. if a relative path is supplied. Test script: --------------- <?php echo getcwd() . DIRECTORY_SEPARATOR . 'test' . PHP_EOL; echo realpath('test') . PHP_EOL; echo disk_total_space(getcwd() . DIRECTORY_SEPARATOR . 'test') . PHP_EOL; echo disk_total_space(realpath('test')) . PHP_EOL; echo disk_total_space('test') . PHP_EOL; // fails ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=71542&edit=1

« previous php.bugs (#235847) next »