Courses/Computer Science/CPSC 457.F2014/Lecture Notes/FileIO

From wiki.ucalgary.ca
< Courses‎ | Computer Science‎ | CPSC 457.F2014‎ | Lecture Notes
Revision as of 16:27, 17 November 2014 by Locasto (talk | contribs) (Created page with "= File I/O = In this session, we will consider the user-level, C lib perspective of file input and output operations. We will contemplate the file abstraction and how it is e...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

File I/O

In this session, we will consider the user-level, C lib perspective of file input and output operations. We will contemplate the file abstraction and how it is exposed on Unix, including naming, addressing, types, utilities, and basic operations. We will also touch on file locking and file attributes.

Note an important link to the topic of IPC (interprocess communication). Files provide a way for processes to communicate safely via the OS.

Files. File input-ouput. Permissions. Attributes. Functions (open/read/write/close/lseek/stat).

  • file permissions and attributes.
  • the difference between FILE and file descriptors
  • stat(1)
  • file(1) / magic numbers / types
  • operations: open, read, write, lseek, close
  • operations: fopen, fread, fwrite, fseek, fclose, EOF

Notes

  • Slides from today.
  • Information showing various properties of the files and directory we manipulated today, including a demonstration of the ln command:

Scribe Notes

  • s1
  • s2
  • s3

Readings

  • MOS: 4.1
  • MOS: 4.2