Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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

 

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91254318

Have any Question?


Related Questions in Computer Engineering

Question suppose that new more powerful arithmetic

Question : Suppose that new, more powerful arithmetic instruction are added to the instruction set. On average, through the use of these more powerful arithmetic instructions, we can reduce the number of arithmetic instr ...

I really do not know where to begin with this

I really do not know where to begin with this asignement. Activity Description A key aspect to planning is having an understanding of some of the layers involved in networks. This assignment examines a few of these layer ...

Query to reterieve data from a customers table in mysql for

Query to reterieve data from a customers table in MySQL for instance who have not placed any orders yet, How to sort results by customers number,How to Modify the query to list customers who have placed fewer than five o ...

What are the uses and value of statistical significance

What are the uses and value of statistical significance testing and the p-value as demonstrated in the various analytical techniques (t-tests, ANOVA, chi-square, etc.). What's the fundamental reason we apply these techni ...

Let a and b be events the symmetric difference atriangleb

Let A and B be events. The symmetric difference A(triangle)B is defined to be the set of all elements that are in A or B but not both. In logic and engineering, this even is also called the XOR (exclusive or) of A and B. ...

Seamus was assigned to created web site plan for a charity

Seamus was assigned to created Web site plan for a charity organization. He must ensure that the site includes the following features: -A message stating the purpose of the charity -An online form that will receive perso ...

A student is curious about how a web site appears on his

A student is curious about how a Web site appears on his computer screen. Draw and explain the communication between a client and a server when the client requests a Web page; use the OSI model as a reference. For exampl ...

Given the following table keynbspand fds repair

Given the following table, key and FDs, REPAIR (RepairInvoiceNumber, RepairDate, RepairCost, RepairEmployeeName, RepairEmployeePhone, SerialNumber, Type, TankCapacity) Candidate Keys: RepairInvoiceNumber, and (RepairDate ...

Salariestask compute the weekly pay for each employee at

Salaries Task: Compute the weekly pay for each employee at the Wahoo Widget Company. For each employee, you will calculate the base pay according to the appropriate salary category, and then subtract taxes and deductions ...

Decision support systems dss what sorts of dss tools do you

Decision support systems (DSS). What sorts of DSS tools do you use at your work - e.g., what-if analysis, sensitivity analysis, scenario analysis, goal-seeking analysis, optimization analysis, etc.? Even if you don't use ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As