Hi,
I want to write code that search for a specific file under the root directory – all drives.
I want all ways to do that; using commands within the code or without
Thankx
Hi,
I want to write code that search for a specific file under the root directory – all drives.
I want all ways to do that; using commands within the code or without
Thankx
You mean like what's in the FAQ?
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
What do you mean?
I need some hints no more
You mean like the FAQ titled
"Accessing a directory and all the files within it"
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
all ways?? here's one way I know..see if it helps:
there's a function called "system()" .check the man pages.THis allows u to execute shell scripts from within ur C program....Keep in mind that U need to escape characters like double quotes when passing the arguments to this function..
So, the shell script that does the searching job will be the argument to this function.
I hope u r using linux...
If u find it difficult to use this directly, u can write a shell program that does the job u want and call theshell programfrom ur C program using the same system() call...
Then the question becomes, "How do I do that in my shell script?"
Here is the FAQ: FAQ > How do I... (Level 3) > Accessing a directory and all the files within it
If you really want to execute a shell script to do the work for you, read this FAQ: FAQ > How do I... (Level 2) > Run a program from within a program
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.