?
Solved

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

Posted on 2006-05-28
5
Medium Priority
?
460 Views
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.

Hints.
 -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.
0
Comment
Question by:dush_1986
  • 3
5 Comments
 
LVL 12

Expert Comment

by:rajeev_devin
ID: 16781680
This is a homework question
0
 

Author Comment

by:dush_1986
ID: 16781687
yes it is and i need help
0
 

Author Comment

by:dush_1986
ID: 16781690
did u do it?
0
 
LVL 23

Accepted Solution

by:
brettmjohnson earned 250 total points
ID: 16781906
> 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.

0
 

Author Comment

by:dush_1986
ID: 16781913
ok i think i got it
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
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 (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
Suggested Courses

571 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