Skip to content

new function for basic filesystem quota evaluation #10210

@bbx-github

Description

@bbx-github

Description

It would be nice to have at least some basic filesystem quota information (on blocks) if there is a filesystem quota set up. Maybe this would only work on ext4/xfs/zfs and needs a different implementation for ntfs?

To complement disk_free_space/disk_total_space the function could look like this:

Description

disk_quota_blocks(string $directory): array|false
Given a string containing a directory, this function will return the number of bytes available on the corresponding filesystem or disk partition for the user id calling this function.

Parameters

directory

A directory of the filesystem or disk partition.

Return Values

Returns the number of blocks in soft limit and number of blocks used as an array of (two) int or false on failure.

Notes

  • I am not a php developer and can not help performing a rfc, I guess.
  • This could be expanded to include hard limit and grace time
  • Maybe output of bytes instead of blocks is preferable as this matches
  • A similar function could be created for inodes (disk_quota_inodes)
  • It gets more complicated if root comes into play and is supposed to get information for other user ids.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions