{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CSC320 chapter4 - CSC 320 Systems Programming Chapter 4...

Info iconThis preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
1 CSC 320 Systems Programming Chapter 4 - File I/O Updated by: Dr. Safwan Qasem Spring 2010 Original version created by: Dr. Mohamed El Bachir Menai
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
2 Introduction Functions available for file I/O (open, read, write …) Most file I/O can be performed using only: open, read, write, lseek, and close Unbuffered I/O Invoke a system call in the kernel (part of ISO C) Centered around file descriptor Standard I/O routines (standard I/O library) Centered around streams (specified by the ISO C standard)
Background image of page 2
3 UNIX files A UNIX file is a sequence of m bytes: All I/O devices are represented as files: /dev/sda2 (/usr disk partition) /dev/tty2 (terminal) The kernel is also represented as a file: /dev/kmem (kernel memory image) /proc (kernel data structures) B 0 ,B 1 ... B m 1
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon