You are here:

C/file handling and organising

Advertisement


Question
I want to detect the file structure in my hard disk through C program.that means all the files and thier paths obviously.I want to write a program to detect all duplicate files in the hard disk and show it to the user.then to organise as per a perticular logic.
    I am using the microsoft visual c++ compiler.I am trying to detect it through generating random names with random extensions.but definitely it is not the efficient way to do it. can u suggest me something?

Answer
First of all, you will have to know the File System and then do the programming. And it cannot be a general solution, and it will not work on another system.
And for collecting duplicate names, follow the "Dictionary" way, where you will create a dictionary of names and when a duplicate one comes, it will be easy to identify it.
Better to use "Hashing Technique" for implementing this.

-ssnkumar

C

All Answers


Answers by Expert:


Ask Experts

Volunteer


Narendra

Expertise

I can answer questions in C related to programming, data structures, pointers and file manipulation. I use Solaris for doing C code and if you have questions related to C programming on Solaris, I will be able to help better.

Experience

6.5

Organizations belong to
Sun Microsystems

Awards and Honors
Brain Bench Certified Expert C programmer.
Advanced System Software Certified

©2012 About.com, a part of The New York Times Company. All rights reserved.