Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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 .

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.

 

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9718167

Have any Question?


Related Questions in Computer Engineering

Write a c program please follow instructions exactly this

Write a C++ program. PLEASE FOLLOW INSTRUCTIONS EXACTLY. This program takes its inputs from a file that contains numbers. The program reads them in as type double. The program outputs to the screen the  standard deviatio ...

Question discuss the advantages and disadvantages of

Question: Discuss the advantages and disadvantages of Incident Response testing. When is each type of testing appropriate? Are there situations that preclude the use of a particular type of testing? Requirement: I recomm ...

Please pick a health care phenomenaproblem and use philip

Please pick a health care phenomena/problem and use Philip Jacobs's descriptive, explanatory and evaluative model (in studying Economics) to analyze it. (Please use the real statistics that you search online and cite the ...

The toronto blue jays raises ticket prices from 100 to 120

The Toronto Blue Jays raises ticket prices from $100 to $120 per seat and experience a decline in ticket sales from 12000 to 10000 per game. i) What is the elasticity of demand for tickets? ii) Assuming the marginal cost ...

A banks assets equal its liabilities under a both

A bank's assets equal its liabilities under a. both 100-percent-reserve banking and fractional-reserve banking. b. 100-percent-reserve banking but not under fractional-reserve banking. c. fractional-reserve banking but n ...

Mccann co has identified an investment project with the

McCann Co. has identified an investment project with the following cash flows. Year Cash Flow  1   $800  2    1,090 3    1,350 4    1,475 a. If the discount rate is 7 percent, what is the present value of these cash flow ...

Simple xml checkerobjectivewrite a program that checks

Simple XML Checker! Objective: Write a program that checks whether or not a given file is formatted correctly for a very simple version of XML. In this simple version of XML you have tags that denote information. Each ta ...

Question explain the need for designing procedures for

Question: Explain the need for designing procedures for simple tasks such as creating or modifying access controls. Create a procedure guide that provides clear instructions that anyone with a basic technical knowledge b ...

Question 1 identify the three main types of computer

Question: 1. Identify the three main types of computer software that were discussed in your unit lesson. Within the three main categories, give examples of each and a brief explanation of each. Each explanation/descripti ...

Probability of weather- money youll make during it-rain

Probability of weather- Money you'll make during it- Rain= .6 $80 Mist= .3 $120 Normal= .1 $200 A) What is the mean? B) What is the variance? C) What is the square root of the variance? I believe this is called the sigma ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As