Reference no: EM13714919
Write a mycopy program that shall copy a file from the program's standard input (stdin) to its standard output (stdout). You are allowed to use only the functions open/read/write/close for I/O: no other I/O functions (such as fprintf, printf, fscanf, scanf) shall be used, except for the user interaction (such as error reporting or printing help messages). The user shall specify the size of the read/write buffer (the number of bytes the program reads/writes "in one shot") on the command line. The data from the original file shall be redirected to the program's standard output, and the standard output of the program shall be redirected to the target file, e.g.:
mycopy 1024 < myfile.orig > myfile.copy
In this example, your program mycopy copies the content of the file myfie.orig into a new file myfile.copy in 1024 byte chunks. Remember that the last fragment of the input file can be shorter than B bytes.
Besides copying the file, the program measures its running time using the gettimeofday function, and reports the result to the standard error output (stderr).
For an arbitrary 10MB file, plot the program running time T against the buffer size B for B=5B, 10, 15, 20, 25, 50, 75, 100, 250, 500, 1kB, 1250B, 2500B, 5kB, 10kB, 25kB, 50kB, 100kB, 250kB, 500kB, 1MB (you may need to use log-log axes). Explain the chart.
You can use dd to create a 10MB zero-filled file named "/tmp/myfile":
dd if=/dev/zero of=/tmp/myfile count=5kB bs=1000
Submit the program source code and the chart. Suggestion: use gnuplot to produce the chart. Do not discard the data you collected to build the chart: you will need them in the future.
Determinants of income differences
: Determinants of Income Differences. Identify one of the determinants of income differences as enumerated in Chapter 30 which you have personally observed or desire to research. Be certain to tell us what you believe was the most significant ec..
|
Assume that the market for wheat is perfect competitive
: Assume that the market for wheat is perfect competitive, with demand curve P = 5000 - 0.01QD and a supply curve P = 1+0.1QS. Each identical wheat producer has a total cost curve given by T C = 1+Q+Q2 which results in marginal cost of MC = 1 + 2Q.
|
What of the importance of cloud computing
: Describe the current state (such as its three layers (Iaas/Paas/Saas)) and future state of Cloud Computing. And explain why, how, and what of the importance of cloud computing. The answers should have at least two pages.
|
How can they be resolved explain
: What are some of the typical problems a project team may encounter during a project's life cycle? How can they be resolved? Explain.
|
A file from the program''s standard input
: Write a mycopy program that shall copy a file from the program's standard input (stdin) to its standard output (stdout). You are allowed to use only the functions open/read/write/close for I/O: no other I/O functions (such as fprintf, printf, fscanf,..
|
The federal government uses many techniques
: The federal government uses many techniques to ensure that multiple high officials are not exposed to the same vulnerabilities at the same time. For example, the president and the vice-president would be taken to separate safe areas in the even..
|
The ciso for chase bank--using the resources available
: Assume to you are the CISO for Chase Bank--using the resources available at PBSC library, find out what laws your state has passed to prosecute computer crime specifically for financial institutions. Create a PowerPoint presentation directed to..
|
Select an existing piece of software
: Select an existing piece of software, an application, a smart device, or anything with computer/software embedded in it, and imagine a new version to be built based on it, or imagine a brand new UI. Now perform the following:
|
Introduction to programming
: Many financial experts advise that property owners should insure their homes or buildings for at least 80 percent of the amount it would cost to replace the structure. Design a modular program that asks the user to enter the replacement cost ..
|