src/FS/File/Writer.php
public function setOwner( $userName )
	{
		if( !$userName )
			throw new InvalidArgumentException( 'No User Name given.' );
		if( !file_exists( $this->fileName ) )
			throw new RuntimeException( 'File "'.$this->fileName.'" is not existing' );
#		if( !$this->isOwner() )
#			throw new RuntimeException( 'File "'.$this->fileName.'" is not owned by current user' );
		if( !$this->isWritable( $this->fileName ) )
			throw new RuntimeException( 'File "'.$this->fileName.'" is not writable' );
		if( !@chOwn( $this->fileName, $userName ) )
			throw new RuntimeException( 'Only a superuser can change file owner' );
	}
public function setOwner( $userName )
	{
		if( !$userName )
			throw new InvalidArgumentException( 'No User Name given.' );
		if( !file_exists( $this->fileName ) )
			throw new RuntimeException( 'File "'.$this->fileName.'" is not existing' );
#		if( !$this->isOwner() )
#			throw new RuntimeException( 'File "'.$this->fileName.'" is not owned by current user' );
		if( !$this->isWritable( $this->fileName ) )
			throw new RuntimeException( 'File "'.$this->fileName.'" is not writable' );
		if( !@chOwn( $this->fileName, $userName ) )
			throw new RuntimeException( 'Only a superuser can change file owner' );
	}
public function setOwner ( $ userName ) { if ( ! $ userName ) throw new InvalidArgumentException ( 'No User Name given.' ) ; if ( ! file_exists ( $ this -> fileName ) ) throw new RuntimeException ( 'File "' . $ this -> fileName . '" is not existing' ) ; #		if( !$this->isOwner() ) #			throw new RuntimeException( 'File "'.$this->fileName.'" is not owned by current user' ); if ( ! $ this -> isWritable ( $ this -> fileName ) ) throw new RuntimeException ( 'File "' . $ this -> fileName . '" is not writable' ) ; if ( ! @ chOwn ( $ this -> fileName , $ userName ) ) throw new RuntimeException ( 'Only a superuser can change file owner' ) ; }
Sets Owner of current File.
@access		public
@param		string		$userName		OS User Name of new File Owner
@return		bool
Sets Owner of current File .