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.)
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.
|