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.:- M9132915

Have any Question?


Related Questions in Computer Engineering

Access your browsers security settings and configure the

Access your browser's security settings and configure the browser to refuse all cookies or to prompt you before allowing a cookie. Restart the browser; then visit several different Web sites. Be sure to visit popular sit ...

Can someone show me a working implementation in c source

Can someone show me a working implementation, in C source code, of a Linux shell that will use shared memory for command execution using pipes that read data from the shared memory region? For example: you type ls -1 | w ...

The next four questions are based on the following you

The next four questions are based on the following: You invested a lump sum of $50,000 in a new company ten years ago and left it there without any further investments and now, today, the company listed on the stock exch ...

A humane society claims that less thannbsp33 of us

A humane society claims that less than 33?% of U.S. households own a dog. In a random sample of 409 U.S.? households, 155 say they own a dog. At alpha(α) = 0.04?, is there enough evidence to support the? society's claim? ...

Question suppose a data packet datagram is sent in the

Question : Suppose a data packet (datagram) is sent in the Internet from a source station (computer) to a destination station. What type of addess (physical, MAC, port address or some other) is used to forward the datagr ...

Question hci theories please respond to the

Question: "HCI Theories" Please respond to the following: • Imagine you are the manager of a medium-sized IT department. While walking through the hall one day, you overhear a senior-level software developer telling a ne ...

University bookstores order books that instructors adopt

University bookstores order books that instructors adopt for the courses. The number of copies order matches the projected the demand. However, at the end of the semester the bookstore has too many copies on hand and mus ...

Question suppose now that after each turn a single six-face

Question : Suppose now that after each turn, a single six-face die is tossed. If it comes out to one, a single chip is removed from the fourth pile; otherwise, the board is left as is. Describe an efficient algorithm tha ...

Question what are four important tactical tasks for a

Question: What are four important tactical tasks for a negotiator in a distributive situation to consider? Discuss one instance where you have been involved in distributed bargaining. What was the outcome? The response m ...

1 why is it unlikely for magnesium to form a cation with a

1) Why is it unlikely for magnesium to form a cation with a charge of +1? 2) How can you tell whether disilicon hexabromide is considered an ionic or molecular compound according to its formula or name?

  • 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