Get free space
Hello, several month ago I tried to apply quota to nextcloud-based application.
At first I found out that freeSpace from OC_Helper always returns INF, no matter what quota I set. I thought it happens because it marked as 'legacy'. I picked \OC\Files\Filesystem::free_space($HomeDir); method and wrote some code. It works gracefully in my environment, but through issues I got it may return 0 in other environments.
Do these methods work in your environment? What is the recommended way to check quota?
Steps to reproduce
- Add
OC_Helper::freeSpace($dir)or\OC\Files\Filesystem::free_space($dir);to your code. - Watch the returned value.
Expected behaviour
Should return the space left.
Actual behaviour
In my case OC_Helper::freeSpace($dir) always return INF.
My Server configuration
Operating system: CentOS 7.5 Web server:: Apache 2.4.6 Database: MariaDB 5.5.56 (also checked on 10.3.8) PHP version: v7.0.33 (checked with v7.0.31 as well) Nextcloud version: 15.0.7 Updated from an older Nextcloud/ownCloud or fresh install: updated
As this is more of a question, please ask this at https://help.nextcloud.com/c/dev/11. Thanks!