From 7e0f021a9aec35fd8e6725e87e3313b101d26f5e Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sun, 27 Jan 2008 11:37:44 +0100 Subject: Initial import (2.0.2-6) --- reference/C/MISC/io.html | 89 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 reference/C/MISC/io.html (limited to 'reference/C/MISC/io.html') diff --git a/reference/C/MISC/io.html b/reference/C/MISC/io.html new file mode 100644 index 0000000..356986c --- /dev/null +++ b/reference/C/MISC/io.html @@ -0,0 +1,89 @@ +Input and Output + +
+
+

Input and Output

+
+
+

+The C language does not have any I/O capability! You can access +files and devices via two groups of functions, these can be split +as shown below.

+ +

+ +

Low Level I/O

+ +Low level functions provide direct access to files and devices. If you +only need file read and write you should use the +
ANSI functions as your code will remain portable. +If you want to access things like, serial ports, virtual memory and +tape drives, low level I/O is for you.

+ +Low level functions reference files by a +file descriptor, this descriptor +is created with the open function and +can be referenced by functions like:

+close
+read
+write
+mmap - Memory map (Not supported on Linux).
+ioctl I/O control.

+ +Three 'file descripters' are opened automatically when your program runs. +These are: +

+	File		Default
+	Desc	Name	device
+	----    ----	------
+	0	stdin	Keyboard
+	1	stdout	Screen
+	2	stderr	Screen
+
+ +If you want to use these 'file descriptors', you do not have to issue an +'open'. + + + +

ANSI standard functions

+ +These functions are defined in the +
stdio.h header. + +The important thing to remember with these functions is the data +is presented in a consistant manor across all platforms. A record +is considered to be 0 or more characters followed by a +newline character. +If the actual (physical) record is terminated in some other way, the +functions will perform the conversion for you. +
+

+

+ + + + +
+Top + +Master Index + +C Keywords + +Functions +
+
+

+


+
Martin Leslie + +
+ -- cgit v1.2.3-54-g00ecf