[SOLVED] COMP3300 Assignment 1-principles of copying files from the OS via system-calls

35.00 $

Programming resource
Digital learning resource
Category:
✓ Practical programming resource
✓ Suitable for guided study and reference
✓ Tutor guidance available when needed

Description

5/5 - (1 vote)

The aim of this assignment is to help students understand the main principles of copying files from the OS point of view, i.e. via using system-calls. Students will obtain hands on experience in copying files, system-calls, and working with APIs.

Tasks:

Section 2.3 of the textbook and Chapter 2 of the class slides describe a program that copies the contents of one file to a destination file. This program works by first prompting the user for the name of the source file and destination files. Write this program using an API of your choice, either Windows API, POSIX API, of Java API; though, I prefer that you use the POSIX API. Make sure you include all necessary error checking, including ensuring that the source file exists.

The system-call sequence for this program (which copies the contents a source file to the destination file) is shown below.

Once you have correctly designed and tested the program, if you used system that supports it, run the program using a utility that traces system-calls. Linux systems provide the strace utility, and Solaris and Mac OS X systems use the dtrace command. As Windows systems do not provide such features, you will have to trace through the Windows version of this program using a debugger (or via the debugger/IDE you are using).

 

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.