qio - quick I/O part of InterNetNews library


   #include "qio.h"

   QIOopen(name, size)
       char             *name;
       int              size;

   QIOfdopen(fd, size)
       int              fd;
       int              size;

       QIOSTATE         *qp;

   char *
       QIOSTATE         *qp;

       QIOSTATE         *qp;

       QIOSTATE         *qp;

       QIOSTATE         *qp;

       QIOSTATE         *qp;

       QIOSTATE         *qp;

       QIOSTATE         *qp;


   The routines described in this manual page are part of the InterNetNews
   library, libinn(3).  They are used to  provide  quick  read  access  to
   files.  The letters ``QIO'' stand for Quick I/O.

   QIOopen  opens  the  file  name  for reading.  It uses a buffer of size
   bytes, which must also be larger then the longest expected  line.   The
   header  file  defines  the constant QIO_BUFFER as a reasonable default.
   If size is zero, then QIOopen will call stat(2) and  use  the  returned
   block  size;  if that fails it will use QIO_BUFFER.  It returns NULL on
   error, or a pointer to a handle to be used in other  calls.   QIOfdopen
   performs  the  same  function  except that fd refers to an already-open

   QIOclose closes the open file and releases any resources used by it.

   QIOread returns a pointer to the next line in the file.   The  trailing
   newline  will  be  replaced  with  a  \0.   If EOF is reached, an error
   occurs, or if the line is longer than the buffer, QIOread returns NULL.

   After a successful call to QIOread, QIOlength will return the length of
   the current line.

   The  functions  QIOtoolong  and  QIOerror  can  be called after QIOread
   returns NULL to determine if there was an error, or if the line was too
   long.   If  QIOtoolong  returns non-zero, then the current line did not
   fit in the buffer, and the next call to QIOread will try read the  rest
   of  the  line.   Long lines can only be discarded.  If QIOerror returns
   non-zero, then a serious I/O error occurred.

   QIOtell returns the lseek(2) offset at which the next line will start.

   QIOrewind sets the read pointer back to the beginning of the file.

   QIOfileno returns the descriptor of the open file.

   QIOlength, QIOtoolong, QIOerror, QIOtell, and QIOfileno are implemented
   as macro's defined in the header file.


          QIOSTATE             *h;
          long                 offset;
          char                 *p;

          h = QIOopen("/etc/motd", QIO_BUFFER);
          for (offset = QIOtell(h); (p = QIOread(h)) != NULL; offset = QIOtell(h))
              printf("At %ld, %s\n", offset, p);
          if (QIOerror(h)) {
              perror("Read error");


   Written  by  Rich  $alz <rsalz@uunet.uu.net> for InterNetNews.  This is
   revision 1.7, dated 1993/01/29.



Personal Opportunity - Free software gives you access to billions of dollars of software at no cost. Use this software for your business, personal use or to develop a profitable skill. Access to source code provides access to a level of capabilities/information that companies protect though copyrights. Open source is a core component of the Internet and it is available to you. Leverage the billions of dollars in resources and capabilities to build a career, establish a business or change the world. The potential is endless for those who understand the opportunity.

Business Opportunity - Goldman Sachs, IBM and countless large corporations are leveraging open source to reduce costs, develop products and increase their bottom lines. Learn what these companies know about open source and how open source can give you the advantage.

Free Software

Free Software provides computer programs and capabilities at no cost but more importantly, it provides the freedom to run, edit, contribute to, and share the software. The importance of free software is a matter of access, not price. Software at no cost is a benefit but ownership rights to the software and source code is far more significant.

Free Office Software - The Libre Office suite provides top desktop productivity tools for free. This includes, a word processor, spreadsheet, presentation engine, drawing and flowcharting, database and math applications. Libre Office is available for Linux or Windows.

Free Books

The Free Books Library is a collection of thousands of the most popular public domain books in an online readable format. The collection includes great classical literature and more recent works where the U.S. copyright has expired. These books are yours to read and use without restrictions.

Source Code - Want to change a program or know how it works? Open Source provides the source code for its programs so that anyone can use, modify or learn how to write those programs themselves. Visit the GNU source code repositories to download the source.


Study at Harvard, Stanford or MIT - Open edX provides free online courses from Harvard, MIT, Columbia, UC Berkeley and other top Universities. Hundreds of courses for almost all major subjects and course levels. Open edx also offers some paid courses and selected certifications.

Linux Manual Pages - A man or manual page is a form of software documentation found on Linux/Unix operating systems. Topics covered include computer programs (including library and system calls), formal standards and conventions, and even abstract concepts.