subject

1 Objectives: Practice with system calls to: a) perform file operations; and b) create and use processes.
2. Description:
Overview: You will write a program (says wordcount. c) to find out the number of words in multiple text files. Specifically, the program will first determine the number of files to be processe Then, the program will create multiple processes with each process being responsible for one file to count its words. The typical format to run the program with input parameters is as follows: /wordcount File_1 File 2 File n
Details: First, the program needs to determine the number of files to be processed. This can be done with the argc parameter of the main function; Then, the argv parameter can be used to retrieve the name for each file.
After that, fork) system call will be used to create multiple processes (one for each file). For each child process, it can simply invoke a function to count the number of words inside a specific file and print out the result like (note that, no inter-process communication is required as child processes will report (i. e., print out) their results individually):
Child process for File_x: number of words is XXX
The main process should wait until all child processes report their results; then, the main process report the end of the program with the print out: All n files have been counted!
For word counting, you could simply use the space character as the delimiter. Anything that are not separated by the space will be counted as a single word. For instance, the example "The first program is a Hello-world." will be reported as 6 words (where Hello-world is counted as a single word). You could compare your results using the wc utility that is available on Linux machines.
3. Submission Requirements
The assignment needs to be submitted on Blackboard. The submission includes two parts:
A. Source codes: This assignment should have only one source file (wordcount. c) and multiple header files (as you lik. Your program needs to have proper comments (e. g explanations for functions and variables etc.). It will be graded based on both functional correctness and clearity of the necessary comments.
B. Report. txt: In this text file, you need to report: a) the status of your program (completed or not; partial credit will be given even the program is not completed); b) the design of your program (what and how system calls are utilized etc.); c) what help (if any) you get from TA and/or your classmates; and d) comments and suggestions to improve this assignment.
C. Submission: Please have all the above files zipped into a single file assignl-abc123.zip and upload the file on Blackboard, where abc123 should be your UTSA ID.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:20
The reset circuit used on the four 3-bit counters analyzed in this activity reset the counts to zero (000). it makes sense for the up-counters to start at zero (000), but the down-counters should start at seven (111). what would you need to change so that the 3-bit binary down counter with j/k flip-flops you just created would reset to seven (111)?
Answers: 1
question
Computers and Technology, 22.06.2019 11:30
Write a function so that the main program below can be replaced by the simpler code that calls function original main program: miles_per_hour = float( minutes_traveled = float( hours_traveled = minutes_traveled / 60.0 miles_traveled = hours_traveled * miles_per_hour print('miles: %f' % miles_traveled) sample output with inputs: 70.0 100.0 miles: 116.666667
Answers: 3
question
Computers and Technology, 22.06.2019 18:30
Which of the following commands is more recommended while creating a bot?
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
You wanted to look up information about alzheimer's, but you were unsure if it was spelled "alsheimer's" or "alzheimer's." which advanced search strategy would be useful? a) a boolean search b) using a wild card in your search c) trying different search engines d) doing a search for "alsheimer's not alzheimer's" asap. ill give brainlist.
Answers: 1
You know the right answer?
1 Objectives: Practice with system calls to: a) perform file operations; and b) create and use proc...
Questions
question
Physics, 28.01.2020 11:31
question
Mathematics, 28.01.2020 11:31
question
Mathematics, 28.01.2020 11:31
Questions on the website: 13722359