How do you determine whether to use a stream function or a low-level function? Ans. Stream functions such as fread() and fwrite() are buffered and are more efficient when reading and writing text or binary data to files. You generally gain better performance by using stream functions rather than their unbuffered low-level counterparts such as read() and write(). In multiuser environments, however, when files are typically shared and portions of files are continuously being locked, read from, written to, and unlocked, the stream functions do not perform as well as the low- level functions. This is because it is hard to buffer a shared file whose contents are constantly changing. Generally, you should always use buffered stream functions when accessing nonshared files, and you should always use the low-level functions when accessing shared files. - Study24x7
Social learning Network
12 Apr 2023 11:28 AM study24x7 study24x7

How do you determine whether to use a stream function or a low-level function? Ans. Stream functions such as fread() and fwrite() are buffered and are more efficient when reading and writing text or binary data to files. You generally gain better performance by using stream func...

See more

study24x7
Write a comment
Related Questions
500+   more Questions to answer
Most Related Articles