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

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  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.

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