Question
Objective The objective of this assignment is to familiarize yourself with the standard system calls and how to use them in a program. Assignment: Simple
Objective
The objective of this assignment is to familiarize yourself with the standard system calls and how to use them in a program.
Assignment: Simple File Copy Program
Write a C/C++ program that only uses only standard system calls to copy the contents of one file to another file. You should only have to use the open(), close(), read() and write() system calls. You can use printf() or fprintf() for error or informational messaging. Your program should not explicitly prompt the user for input/output filenames but rather those should be provided on the command line.
Simple File Copy Program Implementation
The program () is a simple text-based program that takes two arguments from the command line, again no prompting the user from within the program.
1.To start the program
./filecpy
where is the file that is to be copied and is the file that is copied to. After your program completes you should be able to do a diff command on the two files and they should be identical. Last step is to run your program with strace to determine the number of system calls made.
Error Handling
Perform the necessary error checking to ensure that the input file exists and that the output file can be written. You can use the system error errno and strerror to provide additional error messaging.
Grading
The program will be graded on the basic functionality, error handling and how well the implementation description was followed. Be sure to name your program filecpy.c (no extra characters, capitals) and include the output from the strace command. Note that documentation and style are worth 10% of the assignment's grade!
Submission
The program (source code only) should be posted to cougar courses on the due date.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started