MyFind to perform the task of a simplified find Unix utility, in C programming

Posted on 2006-05-28
Last Modified: 2008-09-22
Write a C program, called myFind, to perform the task of a simplified find Unix utility. Your program, should look for a file name or a directory name(string), provided as a command line parameter, either in the current directory or in any of its sub directories. The search should be recursive so that all the subdirectories will be searched. Basically, the program will be searching a string pattern in a tree structure whoes root is the directory from which the program myFind has been called.

 -You can assume that each item in the current directory is a subdirectory. However, if the item is a file, the opendir() system call will return NULL
- Ignore the 2 special directories . and ..
- When you consider a subdirectory, its pathname is the concatenation of the current directory pathnamr with the name of the subdirectory considered.
Question by:dush_1986
    LVL 12

    Expert Comment

    This is a homework question

    Author Comment

    yes it is and i need help

    Author Comment

    did u do it?
    LVL 23

    Accepted Solution

    > yes it is and i need help

    What kind of help do you need?  Obviously we cannot do your homework for you, but we can help you get by trouble spots.

    It seems most of what you need has been laid out for you by your instructor.  The first hint tells you to use opendir (and it companion call readdir) to read the names of the files and subdirectories in a directory.  You should consider using recursion to process subdirectories.


    Author Comment

    ok i think i got it

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    stack 22 143
    Goodbye, so long 10 82
    remove a token in c programming 7 130
    c++ substatte a varabe for a string in a LPCTSTR statment 8 69
    Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
    Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode ( They will have you believe that Unicode requires you to use…
    The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
    The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now