ICT374 Lab 7.docx - ICT374 Lab 7 Text Processing in C Tokenization of Input Lines Reading and Writing Files Creating New Files Setting Access

ICT374 Lab 7.docx - ICT374 Lab 7 Text Processing in C...

This preview shows page 1 - 3 out of 7 pages.

ICT374 Lab 7: Text Processing in C, Tokenization of Input Lines, Reading and Writing Files, Creating New Files, Setting Access Permissions on Files, Duplicating File Descriptors, Standard Input and Output Redirections, Getting File Attributes, Changing Read and Write Offsets, Non-blocking Reads, Accessing Directory Entries. Learning Objectives: 1. Learn to process texts with C's string handling functions. 2. Learn to break an input line into a sequence of tokens. 3. Learn to read and write files using file related systems calls such as open , read , write , lseek , and close . 4. Learn to create new files with open and creat systems calls and to delete files with unlink . 5. Learn to set access permissions on new files with open or creat systems calls. 6. Learn to duplicate file descriptors and understand how shell's standard input and standard output redirections are implemented. 7. Learn how to get file attributes, such as access permissions, the file type, i-node number, file size, ownership and time stamps, using systems call stat , fstat and lstat . 8. Learn how to change file descriptor flags and file status flags using systems call fcntl . 9. Learn how to read directory entries using directory related functions such as opendir , readdir , rewinddir and closedir . Required Reading: Lecture Notes for Topic 5 Functions in string.h .Functions in string.h . The manual pages of the string related functions and file related related system calls and functions
Image of page 1
C Programming Exercises Note, all exercises must be done via the terminal commands, not GUI tools. Do not use IDE to build your programs. Do not use GUI file managers to manage your directories and files. Also each exercise should be in a separate directory, which itself, is under a directory called lab07
Image of page 2
Image of page 3

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture