public static function createFromFileOwner($filename)
    {
        if (!file_exists($filename)) {
            throw new \InvalidArgumentException('Invalid file name provided.');
        }
        if (!function_exists('posix_getuid')) {
            throw new PosixNotAvailableException(
                'Could not retrieve information about the operating system user because POSIX functions '
                . 'are not available to your PHP executable.'
            );
        }
        if (false === $uid = \fileowner($filename)) {
            throw new \Exception('Could not get the owner of the file "' . $filename . '".');
        }
        return new User($uid);
    }