Implement two different versions of file copy utility

Assignment Help Programming Languages
Reference no: EM1372754

You will implement two different versions of a file copy utility, one using read()/write() operations and one using mmap(). You are only allowed to use the following system calls: open(), close(), read(), write(), lseek(), mmap(), munmap(), stat(), lstat(), fstat(). You may also use fprintf() to report errors, and getenv() to read environment variables. Specifically, if the environment variable X_MY_COPY is set to READ+WRITE then your program should use read()/write() to copy the file. If it is set to MMAP, your program should use mmap(). If it is not set, or set to some other value, your program should report an error and exit. Your program should take two arguments, a source pathname and a destination pathname, e.g., mycopy /tmp/foo bar

At the end of the copy operation (regardless of which type it was), print some diagnostics (e.g., number of bytes copies, elapsed time, anything else you think might be useful or interesting); you can use appropriate system calls (e.g., time()) to retrieve the relevant information.

Additionally, if the user specifies the -r command-line flag, you should remove the source file if the copy has been successful. (You can use the unlink() system call for that.)

Reference no: EM1372754

Questions Cloud

What is the smallest displacement : A 24 rifle bullet travelling 260 buries itself in a 3.10 pendulum hanging on a 2.9 long string, which makes the pendulum swing upward in an arc. Resolve the vertical and horizontal components of the pendulum's displacement.
Effects of different drugs : You're interested in finding out more about the effects of different drugs . For each of the following drugs: amphetamine, MDMA (ecstasy), and nicotine, use your available resources to research those drug and then discuss the following:
What will be the car stopping distance : A flight attendant pulls her 69N flight bag a distance of 246m along a level airport floor at a constant velocity. The force she exerts is 37N at an angle of 58° above the horizontal. Find the coefficient of kinetic friction between flight bag and..
Describe what does healthcare organization produce : Describe what does healthcare organization produce and what are the production costs for a hospital organization?
Implement two different versions of file copy utility : You will implement two different versions of file copy utility, one by using read()/write() operations and one by using mmap(). You are only prmitted to use following system calls:
Find out the speeds of the two objects : A m1 = 14.50 kg object and a m2 = 10.00 kg object are suspended, joined by a cord that passes over a pulley with a radius of 10.00 cm and a mass of 3kg.
Calculating firms total revenue, cost and profits : Some games of strategy are cooperative. One example is deciding which side of road to drive on. It does not matter which side it is as long as everyone chooses similar side.
What is the magnitude of the torque : A flute player hears four beats per second when she compares her note to the 523 tuning fork (the note C). She can match the frequency of the tuning fork by pulling out tuning joint to lengthen her flute slightly. What are the three possible value..
How fast is the center of mass of two-stone system : A stone is dropped at t = 0. A second stone, with 6 times the mass of the first, is dropped from the equivalent point at t = 59 ms. (a) How far below the release point is the center of mass of the two stones.

Reviews

Write a Review

Programming Languages Questions & Answers

  Create class for factory workers are paid certain amount

Create class for Factory workers are paid a certain amount for each unit they make and their total pay is the number of units produced times the pay per unit.

  Create a java application for employee class

Create a Java application, that support the following:- Create an Employee class, which holds following information: Employee First Name, Employee Last Name.

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

  Write program which simulates checkout queue object

Write program which simulates checkout line at supermarket. Line is queue object. Customers (i.e., customer objects) arrive in random integer intervals of 1-4 minutes.

  Write code to takes input from console

Write code using C++ which takes input from console and displays output on console. You will write program which takes user input, does some basic arithmetic, and displays the results.

  Describe purpose of keyword super in programs

Describe purpose of keyword 'super' in programs

  Creating application to test class rectangle

Write down application to test class Rectangle.

  Write a method that returns the value of base exponent

Write a method IntegerPower(base, exponent) that returns the value of base exponent For example, IntegerPower(3, 4) = 3 * 3 * 3 * 3.

  Creating loop to find number of items bought based on price

Make a block using a loop that will find the number of items that can be bought based on the price of the item and the total amount available to spend.

  Create class to calculate perimeter and area rectangle

Create class Rectangle. The class has attributes length and width, each of which defaults to 1. It has read-only properties that calculate the Perimeter and the Area of the rectangle.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Create ajax-based product catalog

Create an AJAX-based product catalog which obtains its data from JSON files located on the server. The data should be separated into four JSON files.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd