In low level disk I/O, data cannot be written as individual characters, or as strings or as formatted data. There is only one way data can be written or read in low level disk I/O functions—as a buffer full of bytes
Writing a buffer full of data resembles the fwrite( ) function. However, unlike fwrite( ), the programmer must set up the buffer for the data, place the appropriate values in it before writing, and take them out after writing. Thus, the buffer in the low level I/O functions is very much a part of the program, rather than being invisible as in high level disk I/O functions.
Low level disk I/O functions offer following advantages:
(a) Since these functions parallel the methods that the OS uses to write to the disk, they are more efficient than the high level disk I/O functions.
(b) Since there are fewer layers of routines to go through, low level I/O functions operate faster than their high level counterparts.
Let us now write a program that uses low level disk input/output functions.
No comments:
Post a Comment