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 the program which processes test data

Write the program which processes test data. Output must be student's ID, followed by answers, followed by test score, followed by test grade. Suppose the following grade scale.

  Write the program which simulates shopping

Write the program which simulates shopping. Program must have a loop which continues as long as user wants to shop. Each time through loop read in name, price, and quantity of the item.

  Benefits of validating the forms

When you are collecting data, you need to consider what data to collect, why you are collecting the data. What are other benefits of validating your forms? How are forms validated? What are some form validation best practices?

  Program to help gymnasium help desk associate

Write a program that helps a gymnasium help desk associate to answer questions about membership cost. The rates are as follows.

  Compute and display number of miles per hour

Once correct data has been entered, the program muts compute and display number of miles per hour over the speed limit that the driver was doing.

  Two-level memory cache hierarchy

Explain how you would pipeline the four following pairs of statements.

  Characteristics used for biometric user authentication

You have just been promoted to manager of computer security for large enterprise (XYZ Corporation). Your first project as security manager is to estimate principal physical characteristics used for biometric user authentication.

  Program for insertion sort and selection sort algorithms

Write a program involving the insertion sort, merge sort and selection sort algorithms.

  Design the logic for application for company

Design logic for an application for company which wants a report containing a breakdown of payroll by department. Input includes each employee's last name, first name, department number.

  Differentiating client-side and server-side scripting

Understanding difference between client-side and server-side scripting is significant when developing interactive sites. When and why should you use client-side versus server-side scripting?

  Create-implement simple class using static variables-methods

This third programming project is intended to demonstrate your knowledge of the following: create and implement a simple class. properly use static variables, methods and constants

  Program for vehicle registration department

Consulting firm has narrowed the choice of programming language to Java and C#. Which language do you believe would be more suitable for this application and why?

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