server icon indicating copy to clipboard operation
server copied to clipboard

Get free space

Open Irillit opened this issue 7 years ago • 1 comments

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

  1. Add OC_Helper::freeSpace($dir) or \OC\Files\Filesystem::free_space($dir); to your code.
  2. 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

Irillit avatar Sep 11 '19 14:09 Irillit

As this is more of a question, please ask this at https://help.nextcloud.com/c/dev/11. Thanks!

szaimen avatar May 26 '21 11:05 szaimen