Skip to content

Commit 91e4e6a

Browse files
committed
Minor additions to the file copy slide.
1 parent 1f1fd45 commit 91e4e6a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

file-api.tex

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,9 @@
333333
\item The example above is complete. You can cut-and-paste, compile, and run
334334
it. Obviously, due to the slide size constraint, it is missing several error
335335
checks otherwise needed for a well behaved utility, like checking \texttt{argc}
336-
before using \texttt{argv}, or checking return values for \texttt{open} and
337-
\texttt{creat}.
336+
before using \texttt{argv}, or checking return values for \texttt{open},
337+
\texttt{creat}, \texttt{read}, and \texttt{write}, and reporting possible
338+
errors.
338339
\item It is not efficient to read and write by a few bytes as each system call
339340
costs a certain overhead, independent on the size of the processed block. It is
340341
much better to read and write larger blocks, say 8-1024KB. You can
@@ -347,7 +348,8 @@
347348
overhead.
348349
\item If you need to work with little pieces of data read from files, you can
349350
use stream oriented functions that internally buffer the data -- \texttt{fopen},
350-
\texttt{fread}, \dots
351+
\texttt{fread}, \dots However, please do not use those functions in your
352+
semester assignment and at the exam.
351353
\item Note that we always only write as many bytes as we actually read. See
352354
page \pageref{READCALL} for more information on when we can read/write less data
353355
than requested.

0 commit comments

Comments
 (0)