files man page on DragonFly

Man page or keyword search:  
man Server   44335 pages
apropos Keyword Search (all sections)
Output format
DragonFly logo
[printable version]

FILES(3)		     C Programmer's Manual		      FILES(3)

NAME
       xgetaline,  xfseek, xfopen, xfclose, getaline, fassert - file manipula‐
       tion utilities

SYNOPSIS
       #include <files.h>

       FILE *xfopen(const char *filename, const char *mode);
       void xfclose(FILE *fp);
       void xfseek(FILE *fp, long offset, int origin);
       char *getaline(FILE *fp);
       char *xgetaline(FILE *fp);
       void fassert(FILE *fp);

DESCRIPTION
       These functions are useful for file manipulation.  The  functions  that
       begin  with  x  work  like  the functions without the letter, except if
       there is an error, they print an error message and kill the program.

       getaline reads a line from the given file.  It allocates the memory for
       the  line with malloc(3), and returns a pointer to the beginning of the
       line.  If there is an error, it returns NULL.  If the returned value is
       not  NULL,  the caller is responsible for freeing the memory.  The new‐
       line is removed from the end of the line.

       fassert checks that the argument is not NULL, and that (for a  non-NULL
       argument)  the  file  does  not	have its error indicator flag set.  If
       either condition is true, it prints an error message and termiantes the
       program.	   If neither condition is true, it does nothing.  This can be
       used to add checks that the I/O in a program is going well; however, it
       is mostly useful only for small programs, because more serious programs
       need to handle the errors more gracefully.

SEE ALSO
       publib(3)

AUTHOR
       Lars Wirzenius (lars.wirzenius@helsinki.fi)

Publib			     C Programmer's Manual		      FILES(3)
[top]

List of man pages available for DragonFly

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net