|
81 | 81 |
|
82 | 82 | \begin{slide} |
83 | 83 | \sltitle{Opening a file: \texttt{open()}} |
| 84 | +ifdef([[[NOSPELLCHECK]]], [[[ |
84 | 85 | \texttt{int \funnm{open}(const char *\emph{path}, int \emph{oflag}, |
85 | 86 | ... );} |
| 87 | +]]]) |
86 | 88 | \begin{itemize} |
87 | 89 | \item opens a file \texttt{path}, returns its file descriptor. The |
88 | 90 | \texttt{oflag} is an OR combination of the following flags: |
|
151 | 153 |
|
152 | 154 | %%%%% |
153 | 155 |
|
| 156 | +ifdef([[[NOSPELLCHECK]]], [[[ |
154 | 157 | \pdfbookmark[1]{creat}{creat} |
| 158 | +]]]) |
155 | 159 |
|
156 | 160 | \begin{slide} |
157 | 161 | \sltitle{Creating a file} |
|
199 | 203 | \begin{itemize} |
200 | 204 | \item attempts to read \emph{nbyte} bytes of data from the object referenced by |
201 | 205 | the descriptor \emph{fd} into the buffer pointed to by \emph{buf} |
202 | | -\item returns the number of bytes actually read, 0 on EOF, -1 on error |
| 206 | +\item returns the number of bytes actually read, 0 on \texttt{EOF}, -1 on error |
203 | 207 | \end{itemize} |
204 | 208 |
|
205 | 209 | ifdef([[[NOSPELLCHECK]]], [[[ |
|
685 | 689 | \item \texttt{F\_GETFL} \dots{} get file opening flags (read/write, append, |
686 | 690 | \dots) |
687 | 691 | \item \texttt{F\_SETFL} \dots{} set file opening flags |
688 | | -(\texttt{O\_APPEND}, \texttt{O\_DSYNC}, \texttt{O\_NONBLOCK}, \texttt{O\_R\-SYNC}, |
689 | | -and \texttt{O\_SYNC}). Setting RO/RW is not allowed, and neither are flags for |
690 | | -creation, truncation, and exclusive access. |
| 692 | +(\texttt{O\_APPEND}, \texttt{O\_DSYNC}, \texttt{O\_NONBLOCK}, |
| 693 | +\texttt{O\_R\-SYNC}, and \texttt{O\_SYNC}). |
| 694 | +Setting ifdef([[[NOSPELLCHECK]]], [[[RO/RW]]]) is not allowed, and neither are |
| 695 | +flags for creation, truncation, and exclusive access. |
691 | 696 | \item \texttt{F\_GETLK}, \texttt{F\_SETLK}, \texttt{F\_SETLKW} \dots{} |
692 | 697 | for file locking |
693 | 698 | \end{itemize} |
|
732 | 737 | \item \texttt{st\_uid}, \texttt{st\_gid} \dots{} user/group ID of owner |
733 | 738 | \item \texttt{st\_mode} \dots{} file type and mode |
734 | 739 | \item \texttt{st\_size}, \texttt{st\_blksize}, \texttt{st\_blocks} |
735 | | -\dots{} total size in bytes, preferred blocksize for filesystem I/O, and number |
736 | | -of 512B blocks allocated |
| 740 | +\dots{} total size in bytes, preferred block size for filesystem I/O, |
| 741 | +and number of 512 byte blocks allocated |
737 | 742 | \item \texttt{st\_atime}, \texttt{st\_mtime}, \texttt{st\_ctime} |
738 | 743 | \dots{} time of last access, last modification, and last i-node modification |
739 | 744 | \item \texttt{st\_nlink} \dots{} number of hard links |
|
811 | 816 |
|
812 | 817 | %%%%% |
813 | 818 |
|
| 819 | +ifdef([[[NOSPELLCHECK]]], [[[ |
814 | 820 | \pdfbookmark[1]{utime}{utime} |
| 821 | +]]]) |
815 | 822 |
|
816 | 823 | \begin{slide} |
817 | 824 | \sltitle{Setting file times} |
|
821 | 828 | ]]]) |
822 | 829 | \begin{itemize} |
823 | 830 | \item changes file last access and modification times |
824 | | -\item cannot change i-node access time (ctime) |
| 831 | +\item cannot change i-node access time (\texttt{ctime}) |
825 | 832 | \item calling process must have write permission for the file |
826 | 833 | \end{itemize} |
827 | 834 | \end{slide} |
|
836 | 843 |
|
837 | 844 | %%%%% |
838 | 845 |
|
| 846 | +ifdef([[[NOSPELLCHECK]]], [[[ |
839 | 847 | \pdfbookmark[1]{link, unlink, rename}{link} |
| 848 | +]]]) |
840 | 849 |
|
841 | 850 | \begin{slide} |
842 | 851 | \sltitle{File name manipulations} |
|
881 | 890 |
|
882 | 891 | %%%%% |
883 | 892 |
|
| 893 | +ifdef([[[NOSPELLCHECK]]], [[[ |
884 | 894 | \pdfbookmark[1]{symlink, readlink}{symlink} |
| 895 | +]]]) |
885 | 896 |
|
886 | 897 | \begin{slide} |
887 | 898 | \sltitle{Symbolic links} |
|
917 | 928 |
|
918 | 929 | %%%%% |
919 | 930 |
|
| 931 | +ifdef([[[NOSPELLCHECK]]], [[[ |
920 | 932 | \pdfbookmark[1]{mkdir, rmdir, opendir, readdir, closedir}{dirfncs} |
| 933 | +]]]) |
921 | 934 |
|
922 | 935 | \begin{slide} |
923 | 936 | \sltitle{Working with directories} |
|
1006 | 1019 |
|
1007 | 1020 | %%%%% |
1008 | 1021 |
|
| 1022 | +ifdef([[[NOSPELLCHECK]]], [[[ |
1009 | 1023 | \pdfbookmark[1]{chdir, fchdir, getcwd}{pwd} |
| 1024 | +]]]) |
1010 | 1025 |
|
1011 | 1026 | \begin{slide} |
1012 | 1027 | \sltitle{Change working directory} |
|
1063 | 1078 | \item \verb#X_OK# \dots{} execution permission test |
1064 | 1079 | \item \verb#F_OK# \dots{} file existence test |
1065 | 1080 | \end{itemize} |
1066 | | -\item in contrast to \texttt{stat()}, the result depends on the process's RUID |
1067 | | -and RGID |
| 1081 | +\item in contrast to \texttt{stat()}, the result depends on the process's |
| 1082 | +\texttt{RUID} and \texttt{RGID} |
1068 | 1083 | \item \emsl{never use this call, it cannot be used in a safe way. See the notes |
1069 | 1084 | below.} |
1070 | 1085 | \end{itemize} |
|
1088 | 1103 |
|
1089 | 1104 | %%%%% |
1090 | 1105 |
|
| 1106 | +ifdef([[[NOSPELLCHECK]]], [[[ |
1091 | 1107 | \pdfbookmark[1]{chmod, chown}{chmodchown} |
| 1108 | +]]]) |
1092 | 1109 |
|
1093 | 1110 | \begin{slide} |
1094 | 1111 | \sltitle{Setting file permissions} |
|
0 commit comments