Question: Zoom in to read everything. I basically need code in C programming language that scans through the directory it is called on and sort each

 Zoom in to read everything. I basically need code in C

Zoom in to read everything. I basically need code in C programming language that scans through the directory it is called on and sort each file in that directory and all files in all subdirectories. The major aspects are that this program will instead spawn a new thread to search each directory and sort each file rather than a new process. Basically a multithreaded sorter that scans throught the directory.

Your code will be reading in and traversing entire starting directory and each contained subdirectory. Your code should open and sort each CSV file found that contains move data. Your code's output will be single CSV file outputted to a file named: Allfiles-sorted-.csv Your code should create a new thread to handle each subdirectory found, and each file found. Each file thread should read in and sort that file using Mergesort. You are welcome to implement another sorting algorith but it must be written entirely your self. Once sorted, Instead of writing out the sorted version, your file threads should write their data in to some common data structure in the heap. Once all CSV files have been sorte your code must take the individually-sorted files and integrate all the results to create a single sorted file containing all the records read in. It would be advisable to insert the per-file data in to a globally-accessible sorted data structure. Be sure to keep this data structure propertly synchronized, however. You will need to make use of synchronization mechanisms to be sure that your updates are handled in a consistent and coherent manner Your code will be reading in and traversing entire starting directory and each contained subdirectory. Your code should open and sort each CSV file found that contains move data. Your code's output will be single CSV file outputted to a file named: Allfiles-sorted-.csv Your code should create a new thread to handle each subdirectory found, and each file found. Each file thread should read in and sort that file using Mergesort. You are welcome to implement another sorting algorith but it must be written entirely your self. Once sorted, Instead of writing out the sorted version, your file threads should write their data in to some common data structure in the heap. Once all CSV files have been sorte your code must take the individually-sorted files and integrate all the results to create a single sorted file containing all the records read in. It would be advisable to insert the per-file data in to a globally-accessible sorted data structure. Be sure to keep this data structure propertly synchronized, however. You will need to make use of synchronization mechanisms to be sure that your updates are handled in a consistent and coherent manner

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!