php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33413 shell_exec return double filesize
Submitted: 2005-06-20 23:47 UTC Modified: 2005-06-20 23:59 UTC
From: ejepsen at gmail dot com Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 4.4.0RC1 OS: FreeBSD
Private report: No CVE-ID: None
 [2005-06-20 23:47 UTC] ejepsen at gmail dot com
Description:
------------
I use shell_exec to retrieve the directory-sizes.

however the filesizes returned are exactly twice the true size.

I believe this may be related to bug #11386

Reproduce code:
---------------
// MBOX_DIR is directory of your mailboxes

echo $du_raw = shell_exec('du -d1 '.MBOX_DIR);

Expected result:
----------------
2 /usr/boxes/jeab690/mbox1
280 /usr/boxes/jeab690/mbox2
32054 /usr/boxes/jeab690/mbox3

Actual result:
--------------
4 /usr/boxes/jeab690/mbox1
560 /usr/boxes/jeab690/mbox2
64108 /usr/boxes/jeab690/mbox3

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-20 23:59 UTC] tony2001@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

No, shell_exec() returns exactly what it gets from the command, it doesn't do any magical actions like summarizing or multiplying by 2.
And no, bug #11386 is not related to your problem.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 30 07:01:28 2024 UTC