public function allFiles() {
        return $this->cata(function(FSObject $obj) {
            if ($obj->isFile()) {
                return array($obj);
            }

            assert($obj instanceof FDirectory);
            $fcontents = $obj->fcontents();
            if (empty($fcontents)) {
                return $fcontents;
            }
            return call_user_func_array("array_merge", $fcontents);
        });
    }