Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#46987 closed defect (bug) (fixed)

Return value of the get_dirsize function is the number of bytes

Reported by: tmatsuur's profile tmatsuur Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.2 Priority: normal
Severity: normal Version: 5.2
Component: Filesystem API Keywords: has-patch
Focuses: docs Cc:


In this doc of the get_dirsize function, the return value is MB.

 * @return int|false|null Size in MB if a valid directory. False if not. Null if timeout.

I tried on some directories, but the actual value returned was the number of bytes.
Is this doc correct?

Attachments (1)

46987.patch (797 bytes) - added by wpboss 5 years ago.

Download all attachments as: .zip

Change History (5)

5 years ago

#1 @wpboss
5 years ago

  • Keywords has-patch added

Yes @tmatsuur you are right. I have checked it and it always returns bytes. I have corrected that in function's documentation. Please let me know any more changes are required.

#2 @SergeyBiryukov
5 years ago

  • Component changed from General to Filesystem API
  • Milestone changed from Awaiting Review to 5.2

Introduced in [33184]. Fixed in [45220] for recurse_dirsize(), but not for get_dirsize().

#3 @SergeyBiryukov
5 years ago

  • Focuses docs added

#4 @SergeyBiryukov
5 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 45249:

Docs: Correct @return description for get_dirsize().

Props wpboss, tmatsuur.
Fixes #46987.

Note: See TracTickets for help on using tickets.