Execute a recursive directory traversal

Assignment Help Computer Engineering
Reference no: EM132495

Question

Execute a recursive directory traversal. As walking the file tree, you will be looking for duplicate files and creating symbolic links to them.

To accomplish directory traversal, you should write a recursive function using the dir family of functions: opendir(), readdir(), chdir() and closedir(). A prototype could look something like this-

void find_unique_files(const char*, char**);

The function have to take a character array representing a filename and an array of strings. If it is known on a directory, it should move into that directory and continue its traversal. If it is known on a text file, it has to generate a hash for text file, check the list of hashes to make sure that it does not already contain that hash, and then insert it if it doesn't. If it does, you know that you have found a duplicate.

The file's hash will be designed using the SHA1 hashing algorithm. A library for calculating this hash is able to be found in <openssl/sha.h>.

When a duplicate file is discovered, you will create a symbolic link to duplicate (the one which cannot be added to the list) in the /dups directory using the symlink() function

Symlink - pathname to a file, in fact a string.

 

Reference no: EM132495

Questions Cloud

Write general journal entries to record the transactions : Write general journal entries to record the transactions and Write a stockholders' equity section as of the close of business on December 31, 2012.
What is social rehabilitation : What is social rehabilitation How is it different from medical and vocational rehabilitation
Write a program based on encryption scheme : Write a program based on encryption scheme.
Example on balance sheet : What amount can be reported as the noncontrolling interest in the consolidated balance sheet on January 1, 20X9?
Execute a recursive directory traversal : Execute a recursive directory traversal.
What are dangerous goods : What are dangerous goods What is the difference between hazardous materials, dangerous goods and hazardous substances?
Prepare visual basic application : Prepare visual basic application.
Show the cash flows from investing and financing activities : Show the cash flows from investing and financing activities sections of the cash flows statement.
Determine ordering cost per order : Determine ordering cost per order

Reviews

Write a Review

Computer Engineering Questions & Answers

  Illustrate precedence graph

Illustrate precedence graph

  What personnel implications are when setting up a wan

What personnel implications are when setting up a wan? You are hired by a firm that has offices in Peru, France, the United States, and Hungary. Your job is to coordinate a team of IT workers to connect all of individual sites into one large WAN.

  What are pros and cons of society''s increasing reliance data

What are pros and cons of society's increasing reliance data

  What are disadvantages of low class

What are disadvantages of low class What are advantages of high value?

  Write down an account class

Write down an Account Class.

  How can a relation be organized in mass storage

How can a relation be organized in mass storage.

  Program on strings s1 and s2

Program on strings s1 and s2.

  Procedure to generate indexes for foreign keys

Procedure to generate indexes for foreign keys.

  How to redesign the coding design

How to redesign the coding design? Write down a sentence for each change you have optional, indicating what data entry problem (from part a) change will eliminate.

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Explain the method to create a scheme for vb mail order

Explain the method to create a scheme for VB Mail Order

  What is meant by user cantered design

What is meant by ‘user cantered design'

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