public function chown($files, $user, $recursive = false)
    {
        foreach ($this->toIterable($files) as $file) {
            if ($recursive && is_dir($file) && !is_link($file)) {
                $this->chown(new \FilesystemIterator($file), $user, true);
            }
            if (is_link($file) && \function_exists('lchown')) {
                if (true !== @lchown($file, $user)) {
                    throw new IOException(sprintf('Failed to chown file "%s".', $file), 0, null, $file);
                }
            } else {
                if (true !== @chown($file, $user)) {
                    throw new IOException(sprintf('Failed to chown file "%s".', $file), 0, null, $file);
                }
            }
        }
    }
public function chown($files, $user, $recursive = false)
    {
        foreach ($this->toIterable($files) as $file) {
            if ($recursive && is_dir($file) && !is_link($file)) {
                $this->chown(new \FilesystemIterator($file), $user, true);
            }
            if (is_link($file) && \function_exists('lchown')) {
                if (true !== @lchown($file, $user)) {
                    throw new IOException(sprintf('Failed to chown file "%s".', $file), 0, null, $file);
                }
            } else {
                if (true !== @chown($file, $user)) {
                    throw new IOException(sprintf('Failed to chown file "%s".', $file), 0, null, $file);
                }
            }
        }
    }
public function chown ( $ files , $ user , $ recursive = false ) { foreach ( $ this -> toIterable ( $ files ) as $ file ) { if ( $ recursive && is_dir ( $ file ) && ! is_link ( $ file ) ) { $ this -> chown ( new \ FilesystemIterator ( $ file ) , $ user , true ) ; } if ( is_link ( $ file ) && \ function_exists ( 'lchown' ) ) { if ( true !== @ lchown ( $ file , $ user ) ) { throw new IOException ( sprintf ( 'Failed to chown file "%s".' , $ file ) , 0 , null , $ file ) ; } } else { if ( true !== @ chown ( $ file , $ user ) ) { throw new IOException ( sprintf ( 'Failed to chown file "%s".' , $ file ) , 0 , null , $ file ) ; } } } }
Change the owner of an array of files or directories.

@param string|iterable $files     A filename, an array of files, or a \Traversable instance to change owner
@param string          $user      The new owner user name
@param bool            $recursive Whether change the owner recursively or not

@throws IOException When the change fails
Change the owner of an array of files or directories .