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

  Programming for a pattern

Write down a program in order to print the following pattern on screen.

  Program to count the number of times page is opened

Generate a page in order to count the number of times the page is viewed by the user in a single session. Each time page is refreshed or opened in the browser during the session counts as 1 page view.

  Determining the output

Specify the output if input is diamond diamond? State the output if the input is diamond gold?

  Translate following c++ program to pep/8 assembly language

Translate following C++ program to Pep/8 assembly language

  Give the company''s decision support system

Large organizations often link extensive reporting suites to company's Decision Support Systems, in effect creating 'Business Intelligence' (BI) applications.

  Write down an interactive web page named swap.html

Write an interactive Web page named swap.html that contains two text boxes and a button. When the user clicks the button, the contents of the two text boxes should be swapped.

  Define how a form becomes a window

define how a form becomes a window within an application. Discuss the difference between a modal and modeless form. List an example of when you might want to use each kind.

  Discuss the elements of the site that work particularly well

Evaluate how well the design of the First IB web site meets the needs of a potential small business customer.

  Questiondeveloping requests specification for this

questiondeveloping requests specification for this integration. you have to use all of tools available to you to elicit

  Describe two companies with a global presence

I want to construct a PowerPoint Presentation identifying, comparing, and contrasting the IT governance structure for two major companies with a global presence.

  How to create a set in third normal

How to create a set in third normal RESERVATION(reservation id, date of reservation, start date, end date, (( customer id, customer name, customer address, customer type, customer type description, ((customer preferences)), customer credit card n..

  Assess the security risks

As part of your project in order to assess the security risks in order to compute the infrastructure, you have discovered that other managers often have several ideas on the severity and levels of the risk.

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