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

  How to write a class named dayofyear that gets an integer

How to write a class named DayOfYear that gets an integer Day 2 would be January 2 Day 32 would be February 1 Day 365 would be December 31

  Utilize server manager to install dns role

Utilize Server Manager to install DNS role

  Write down a little man computer program

Write down a Little Man Computer program.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Develop a checkout lane simulation

Develop a checkout lane simulation that can be used to determine the optimal number of lanes that Cougar Mart should have open.

  Design a data structure which supports two operations

Design a data structure which supports two operations 1. Insert(S, x) inserts x into S. 2. Remove-Duplicates(S) removes from S all duplicated values.

  What security measures required to address vulnerabilities

What security measures required to address vulnerabilities Illustrate threats and vulnerabilities that are possible after implementing "big data" technologies in online auctioning company.

  Problem on encryption using a one-round version of des

Problem on encryption using a one-round version of DES.

  What are prospect trends for healthcare informatics

What are prospect trends for healthcare informatics.

  Explain how an enterprise would use 3g, 4g and wwan

Explain how an enterprise would use 3G, 4G and WWAN Use at least three quality resources in this project.

  Explore paper on vmware security

Explore paper on VMware Security

  Problem on stack

Problem on Stack

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