Otherwise it would fall into the 'win' else block because strpos($os, 'win') does also match 'darwin' what is the `php_uname` for OS X.
$result = '';
if (strpos($os, 'linux') !== false) {
$result = $this->exec("stat -c %s $arg");
- } else if (strpos($os, 'bsd') !== false) {
+ } else if (strpos($os, 'bsd') !== false || strpos($os, 'darwin') !== false) {
$result = $this->exec("stat -f %z $arg");
} else if (strpos($os, 'win') !== false) {
$result = $this->exec("for %F in ($arg) do @echo %~zF");