logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

VistaIOOpenInputFile, VistaIOOpenOutputFile - open file with error checking

Arguments

filename  Specifies he name of the file to be opened.

       nofail    Specifies whether the routine should exit the program if the file cannot be opened.

Author

       Art Pope <pope@cs.ubc.ca>

       Adaption to vistaio: Gert Wollny <gw.fossdev@gmail.com>

VistaIO Version 1.2.14                             6 June 1994                                VistaIOOpenFile(3)

Description

       These  routines  open  a  file  while  checking for failure and recognizing the special filename ``-'' as
       denoting the standard input or output stream.

       If filename is NULL or it is the string ``-'', either stdin or stdout is returned.  Otherwise, an attempt
       is made to open the named file for  either  reading  or  writing,  as  appropriate.  If  the  attempt  is
       successful, the resulting file pointer is returned.

       The nofail argument determines what happens if a file cannot be opened. If nofail is FALSE then a warning
       message  is  issued  and NULL is returned. If nofail is TRUE then a fatal error message is issued and the
       program is terminated.

Diagnostics

       ``Unable to open input/output file filename.''

Name

       VistaIOOpenInputFile, VistaIOOpenOutputFile - open file with error checking

Return Values

       Either routing returns a pointer to the opened FILE if successful. Otherwise it returns NULL  or  doesn't
       return at all (depending on nofail).

See Also

VistaIOIdentifyFiles(3), VistaIOReadObjects(3), VistaIOWriteObjects(3),

Synopsis

#include<vistaio.h>FILE*VistaIOOpenInputFile(VistaIOStringConstfilename,VistaIOBooleannofail);FILE*VistaIOOpenOutputFile(VistaIOStringConstfilename,VistaIOBooleannofail);

See Also