public function createNewFile($mode = null)
    {
        if ($this->isAbsolute()) {
            if (is_null($mode)) {
                $mode = $this->defaul_permission;
            }

            if ($resource = fopen($this->getPathname(), 'x')) {
                fclose($resource);
                $this->chmod($mode);
                return true;
            }
            return false;
        } else {
            throw new FileException('Given file path is not a absolute path.');
        }
    }
public function createNewFile($mode = null)
    {
        if ($this->isAbsolute()) {
            if (is_null($mode)) {
                $mode = $this->defaul_permission;
            }

            if ($resource = fopen($this->getPathname(), 'x')) {
                fclose($resource);
                $this->chmod($mode);
                return true;
            }
            return false;
        } else {
            throw new FileException('Given file path is not a absolute path.');
        }
    }
public function createNewFile ( $ mode = null ) { if ( $ this -> isAbsolute ( ) ) { if ( is_null ( $ mode ) ) { $ mode = $ this -> defaul_permission ; } if ( $ resource = fopen ( $ this -> getPathname ( ) , 'x' ) ) { fclose ( $ resource ) ; $ this -> chmod ( $ mode ) ; return true ; } return false ; } else { throw new FileException ( 'Given file path is not a absolute path.' ) ; } }
create a empty file, named by the pathname

@param       int     $mode       optional file permission
@return      bool                returns true if the file was successfully created
@throws      FileException
create a empty file named by the pathname