Low-Level Input and Output

The file-handling routines such as fopen, fprintf, and fclose are called “standard” because they're defined in the ANSI standard. Code that uses the standard routines will generally be portable from one machine to another. (The QuickWin routines—such as _fwopen and _wyield—are non-ANSI, and only work with QuickC for Windows.)

In addition to the standard file-handling functions, the QuickC library includes some low-level I/O functions, which allow more direct access to disk files.

The low-level I/O routines (also called “system-level”) are generally not portable. They work in DOS, Windows, and OS/2, but they may not work elsewhere. They're also a little more difficult to use. Instead of declaring a pointer to a FILE structure, you must allocate your own buffer and manage transfer of the bytes yourself. You move values into the buffer, then send the contents of the buffer to disk.

Summary: Low-level routines can be more efficient, but they usually aren't portable.

Low-level routines have some advantages, though. One is that you have more control over the machine. Another is that low-level I/O can be faster than standard I/O, if you know what you're doing, since low-level I/O occurs when you make the call rather than being buffered as standard I/O is.

The choice is up to you: portability versus efficiency. You should choose one or the other; it's not a good idea to mix standard and system-level routines.