Use sysconf to determine the maximum number of standard io

Assignment Help C/C++ Programming
Reference no: EM131125495

Midterm Take-home Examine

Deliverables: Source code and output file
Note: Cheating will receive anF

1. Use sysconf to determine the maximum number of standard I/O streams a process can open at a time. Then try to open this number of streams. How many can you open? Does it match what sysconf reports?
Hint see chapter 2.5.4

2. File I/O programming 

2.1 Write a BASH script to create a random file, "random1", of 2MB 
Hint: 2MB is 512 bytes x 4000, use ‘dd' command

2.2 Use ‘read()' and ‘write()' functions to write a program called ‘copy1' that emulates ‘cp' command to create a copy. 
Example: copy1 random1 random2

2.3 Replace ‘read()', ‘write()‘ in 2.2 above with ‘fread()' and ‘fwrite()', called ‘copy2' 

2.4 Add a loop of 100 in ‘2.2' and ‘2.3', called n'copy3' and ‘copy4', that use time() function to compare which one runs faster. Use ‘fprintf()' to output the results to the screen, right aligned to 78th column 

I/O Mode: Buffered (or unbuffered)
File Size: 1,003,202 bytes
File Last Modified Time: 11/01/2014 01:02:33pm
Total Run Time: 4,323 seconds
Input File Name: random1

3. Write a C program, named ‘hex', to perform like ‘hexdump'

Reference no: EM131125495

Questions Cloud

Journalize the adjusting entry for uncollectible accounts : Using the data in Exercise 9-11, assume that the allowance for doubtful accounts for Fonda Bikes Co. had a debit balance of $4,145 as of December 31, 2010.
Manufacturer wants to maximize the profit of two products : A manufacturer wants to maximize the profit of two products. Product I fields a profit of $ 1.50 per unit, and product II yields a profit of 52.00 per unit. The production level of product I is less than or ethical to 600 units plus three times the p..
Define financial restructuring and describe what is meant : Define financial restructuring and describe what is meant by debt payments extension and debt composition change.
Estimate what the proper balance of the allowance : Estimate what the proper balance of the allowance for doubtful accounts should be as of December 31, 2010.
Use sysconf to determine the maximum number of standard io : 1. Use sysconf to determine the maximum number of standard I/O streams a process can open at a time. Then try to open this number of streams. How many can you open? Does it match what sysconf reports?
What was the major reason for the slave uprising : What was the major reason for the slave uprising? What were the slaves fighting for? How did most slaves fight? Were the uprisings successful?
Compare them with the industry average data : a. Calculate Jimenez's 2011 forecasted ratios, compare them with the industry average data, and comment briefly on Jimenez's projected strengths and weaknesses.
Journalize the adjusting entry for uncollectible accounts : Using data in Exercise 9-8, assume that the allowance for doubtful accounts for Summit Industries has a credit balance of $16,175 before adjustment on November 30.
Define asset restructuring and describe : Define asset restructuring and describe how it can be implemented to escape financial distress.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  C code christmas assignment

C code Christmas assignment. We are supposed to create a record generating programme that will accept user information and output student information (student grade, highest and lowest grade, pass or fail status). Must be done in modular form,..

  Difference between call by value and call by reference

What is the difference between call by value and call by reference in a user defined function in C++?

  Write a program to generate a table of factors

Write a program to generate a table of factors used to compute monthly payments for the money borrowed.

  Program that will read in 8 numbers into an array

Write a program that will read in 8 numbers into an array. Print out the numbers from the array, then print the 2nd number, the 5th number and the last number.

  Prepare a program to show the fibonacci numbers

Write a C++ program to display first 20 Fibonacci numbers in descending order - Prepare a program to show the Fibonacci numbers

  Time constraints and the type of audience

Your supervisor agrees with your proposal but warns you of time constraints and the type of audience you have. Your supervisor outlined the following requirements for you to follow:

  C++ program to convert any base 10 number v to any base b

Write a C++ program that will convert any base 10 number v to any base b. Input two values, the first is the base 10 number and the second value is the base that the base 10 number v is to be converted to. The base can only be between 2 and 9. Inv..

  Calculates average of three exams for each student

The program reads the grades for students, calculates average of three exams for each student, and puts out to another file (called Summarygrades.txt) Student ID average and letter grade: example below,

  Program to check the account status

Place the account record into an appropriate structure, and store the accounts in an array of structures.

  Create two arrays with ten random numbers

Determine the largest difference (only subtract corresponding index numbers) between these two arrays. (hint: create a third array with the differences)

  Variable of primitive type

What value is stored in ch by the following statement? ch = str.charAt(0); What value is stored in ch by the following statement? ch = str.charAt(10);

  Store the numbers in an array

You need to write a program that will read the file 'unumbers.dat', store the numbers in an array, and then prompt the user to search the list for a number.

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