Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

need help on the to do part passing the cmd input to popopen sha5i2sun) 44 1000 31 32 /* The array of names of hash

need help on the to do part
passing the cmd input to popopen image text in transcribed
sha5i2sun) 44 1000 31 32 /* The array of names of hash programs * 33 const string hashProgs[] = ('ndssun", "shalsun", "sha224sum", "sha256sun", "sha384sum", 34 35 / 36 * The function called by a child 37 * @param hashProgName the name of the hash program 38 / 39 vold computeHash(const strings hashProgName) 40 41 char str Received [100]: 42 43 /* The hash value buffer / char hashvalue[HASH_VALUE_LENGTH); 45 46 /* The received file name string */ 47 char fileNameRecy[MAX_FILE_NAME_LENGTH); 48 49 /* Fill the buffer with o's / 50 memset(fileNameRecy, (char)NULL, MAX_FILE_NAME_LENGTH); 51 52 /** TODO: Now, lets read a message from the parent **/ 53 if(read(parent TochtldPlpe[READ_END], strReceived, stzeof(strRecetved)) 61 . For example, sha512 sum fileName. 62 63 string cmdLine(hashProgName); 64 cmdLine + 65 cndLine +- fileNameRecv: 66 67 /* TODO: Open the pipe to the program (specified in endline) 68 using popen() and save the ouput into hashvalue. See popen.cpp for examples using popen. 70 71 72 73 74 75 76 77 FILE" progoutput - popen("ndssun test"); 78 54 sha5i2sun) 44 1000 31 32 /* The array of names of hash programs * 33 const string hashProgs[] = ('ndssun", "shalsun", "sha224sum", "sha256sun", "sha384sum", 34 35 / 36 * The function called by a child 37 * @param hashProgName the name of the hash program 38 / 39 vold computeHash(const strings hashProgName) 40 41 char str Received [100]: 42 43 /* The hash value buffer / char hashvalue[HASH_VALUE_LENGTH); 45 46 /* The received file name string */ 47 char fileNameRecy[MAX_FILE_NAME_LENGTH); 48 49 /* Fill the buffer with o's / 50 memset(fileNameRecy, (char)NULL, MAX_FILE_NAME_LENGTH); 51 52 /** TODO: Now, lets read a message from the parent **/ 53 if(read(parent TochtldPlpe[READ_END], strReceived, stzeof(strRecetved)) 61 . For example, sha512 sum fileName. 62 63 string cmdLine(hashProgName); 64 cmdLine + 65 cndLine +- fileNameRecv: 66 67 /* TODO: Open the pipe to the program (specified in endline) 68 using popen() and save the ouput into hashvalue. See popen.cpp for examples using popen. 70 71 72 73 74 75 76 77 FILE" progoutput - popen("ndssun test"); 78 54

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Conceptual Database Design An Entity Relationship Approach

Authors: Carol Batini, Stefano Ceri, Shamkant B. Navathe

1st Edition

0805302441, 978-0805302448

More Books

Students also viewed these Databases questions