1. Homepage
  2. Exam
  3. [2022] COMP2017/9017 System Programming - Final Exam - Q4 Concurrency

[2022] COMP2017/9017 System Programming - Final Exam - Q4 Concurrency

This question has been solved
Engage in a Conversation

Concurrency - 40% CourseNana.COM

tee -> eet CourseNana.COM

tee is a program that duplicates stdin to stdout AND duplicates stdin to multiple files (append only, no overwrite) CourseNana.COM

  CourseNana.COM

stdin --------------------> stdout CourseNana.COM

|            | CourseNana.COM

|           | CourseNana.COM

V          V CourseNana.COM

FileA     FileB CourseNana.COM

  CourseNana.COM

You are to write the eet program. It multiplexes parts of several files in sequence into a single CourseNana.COM

output (stdout). CourseNana.COM

  CourseNana.COM

eet -d ... [FILE]... CourseNana.COM

  CourseNana.COM

Running the eet program will output a token from each file in alternating order. The token is a CourseNana.COM

sequence of characters delimited by a special character. Each token is printed followed by a new line character. The file is processed until no further tokens exist. If a file has no further tokens, it outputs <filename> no more tokens After a round of multiplexing from each file, a new line is printed. CourseNana.COM

  CourseNana.COM

The eet program must have the flag -d as the first command line argument. The second command line argument are the parameters of -d that are a set of single delimiter characters to define a token. CourseNana.COM

  CourseNana.COM

The remaining parameters are files to provide as input. If the 1st, 2nd, or 3rd command line CourseNana.COM

arguments are missing files then the program will terminate with exit code 1. CourseNana.COM

  CourseNana.COM

Example CourseNana.COM

As an example, consider the input of four files CourseNana.COM

  CourseNana.COM

FileA ----->| CourseNana.COM

| CourseNana.COM

FileB ----->| CourseNana.COM

|-------------> stdout CourseNana.COM

FileC ----->| CourseNana.COM

| CourseNana.COM

FileD ----->| CourseNana.COM

  CourseNana.COM

./eet -d ",.;" FileA FileB FileC FileD CourseNana.COM

  CourseNana.COM

output characters of FileA up to delimiter output characters of FileB up to delimiter output characters of FileC up to delimiter output characters of FileD up to delimiter CourseNana.COM

Get the Solution to This Question

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
COMP2017代写,COMP9017代写,System Programming代写,University of Sydney代写,COMP2017代编,COMP9017代编,System Programming代编,University of Sydney代编,COMP2017代考,COMP9017代考,System Programming代考,University of Sydney代考,COMP2017help,COMP9017help,System Programminghelp,University of Sydneyhelp,COMP2017作业代写,COMP9017作业代写,System Programming作业代写,University of Sydney作业代写,COMP2017编程代写,COMP9017编程代写,System Programming编程代写,University of Sydney编程代写,COMP2017programming help,COMP9017programming help,System Programmingprogramming help,University of Sydneyprogramming help,COMP2017assignment help,COMP9017assignment help,System Programmingassignment help,University of Sydneyassignment help,COMP2017solution,COMP9017solution,System Programmingsolution,University of Sydneysolution,