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

  Application to computer science

Find the matrices that represent the relations.

  Recognize how to locate fsmo roles

Recognize how to locate FSMO roles?

  How to produce a function mult-stream

How to produce a function mult-stream.

  Write down an assembly language program

Write down an assembly language program The product number from one to five (3 characters wide, right justified)

  What is a backup strategy or active directory?

What is a backup strategy or Active Directory? The small business that you created new domain controllers for now wants you to develop a backup and recovery plan for Active Directory.

  Determining the priority of period of execution of irqj

Determining the priority of period of execution of IRQJ

  How to generate paper for pair of public or private rsa key

How to generate paper for a pair of public or private RSA keys? The high-class reporter for foreign affairs learned about asymmetric cryptography, and proposed to security team at the paper to generate for a pair of public or private RSA keys.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  What will be formula of digital certificate of the server

Point out what will be the formula of digital certificate of the server N. we denote the public and private keys of server N as K+ ,N KN, and public or private keys of CA are denoted as K+ CA KCA.

  How to produce a work breakdown structure

How to produce a Work Breakdown Structure. Ensure main WBS tasks headings are the 5 PMBOK® process areas.

  Why didn''t the vendor just bid fewer disks

Why didn't the vendor just bid fewer disks

  Describe stages of the processor

Describe the decode stage and Describe the execution stage of add, andi, mul, divi, and neg.

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