Questionexecute a recursive directory traversal as walking

Assignment Help Computer Engineering
Reference no: EM13348550

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: EM13348550

Questions Cloud

Questionuzi company received a charter granting the right : questionuzi company received a charter granting the right to issue 200000 shares of 1 par value common stock and 10000
Question 1a evaluation of the duration and degree of : question 1a evaluation of the duration and degree of disability after an occupational accident with a single body
Questiontwo parties a and b try to communicate with : questiontwo parties a and b try to communicate with following encryption scheme-both sides agree on same long random
Questionwinner corporation acquired 80 of the common : questionwinner corporation acquired 80 of the common shares and 70 of the preferred shares of first corporation at
Questionexecute a recursive directory traversal as walking : questionexecute a recursive directory traversal. as walking the file tree you will be looking for duplicate files and
Question 1a what are the top four major causes of : question 1a what are the top four major causes of construction fatalities?b explain using examples the necessary
Questionin visual basic 2010 please give completed : questionin visual basic 2010. please give completed application as a .zip filea small airline has just purchased a
Questionrowe furniture corporation is a virginia-based : questionrowe furniture corporation is a virginia-based manufacturer of furniture. in a current quarter it reported the
Questionshoogi perak limited is a manufacturer of pictures : questionshoogi perak limited is a manufacturer of pictures tubes used in assembling t.v sets. the subsequent are

Reviews

Write a Review

Computer Engineering Questions & Answers

  Write the definition of the function print

Write the C++ statements that call the function print to output the contents of the arrays times, speed, trees, and students.

  Write a java program on a good doctor

Write a java program on A good Doctor

  Kinds of digital and logical evidence

State some of the kinds of the digital and logical evidence, and special content data investigators may require to gather during an actual cyber-terrorism case.

  Write the structural vhdl code to implement device

Two voltage and two current sensors indicate measured voltage with 16-bit binary values on their output lines, S15 to S0.

  Soda vending machine design

Soda Vending Machine Design,    A state diagram showing the implementation of your design. Clearly show all the states and the conditions on which transitions occur.

  Give an understanding on the different types of systems

give an understanding on the different types of systems

  Questionpropose a wiring plan for a 1500 ft2 data centre

questionpropose a wiring plan for a 1500 ft2 data centre that consists of 24 cabinets 44u each for network servers plus

  Code to declare the four pointer variables

In C++: A pointer variable may consist of a pointer to a valid object, a pointer to a deleted object, NULL, or the random value. Write down the code which generates and sets four pointer variables a, b, c, and d to display each of these possibilit..

  Write a step-by-step plan including comments that reflect

write a step-by-step plan including comments that reflect changes to the machine state to solvequestion 1. input a b

  Make a powerpoint presentation to share with the owner

A twenty year old company, SewWorld, comprised of six locations in three states, sells sewing machines, sewing related software, and accessories.

  How to generate a class diagram for the entity classes

How to generate a class diagram for the entity classes

  Converting the skip list l into binary search tree t(l)

Any skip list L can be converted into binary search tree T(L)as follows: The root of T(L) is considered as the leftmost node on the highest non-empty level of L the left and right sub-trees.

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