COSC350 SYSTEM SOFTWARE
COSC 350 System Software Lab #3
How to submit
• For each program, you need write detailed comments for each statement.
• You need consider all possible error.
• Submit all codes
• You need demonstrate each task in front of instructor during the next lab hours.
Write a c code to copy a content of any readable file (foo) to a file (clone) without open input
file (use standard input and output (file descriptor 0 and 1) with input output redirection).
Write a c code to copy a content of any readable file (foo) to a file (clone1) with open files.
(created output file mode will be rw-rw-rw). read byte by byte.
Write a c code to copy a content of any readable file (foo) to a file (clone2) with open files using
a buffer with size 32 byte (created output file mode will be rwx-rwx—).
Write a simple c code which open two files (foo, foo1)and append to a file (foo12) by using the
lseek system call (created output file mode will be rwxrw—).
Write a simple c code which open a file (foo) as a input and write into a file by using the lseek
system call (foorev)as a reverse order (created output file mode will be rwxrw—).
Rewrite Task#5 by using pread() system call instead of using lseek() system call.
COSC350 SYSTEM SOFTWARE, SPRING 2021
Write a C program that receive sequence of integers on the command line and prints their sum
to the screen. Define your own function to convert string to integer instead of using atoi
Exit the program with an appropriate error message under the following error condition: There
is not at least one integer on the command line.
Write C code which pass input (text file) and output file name as command line arguments.
Open the input file as read only and open output file with mode rw-rw-rw. Your program
encodes each character to ASCII code number and writes to output file. You need consider
argument number error and open file error. You must not use any library function to convert a
character to ASCII number.