LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   file system indexing (https://www.linuxquestions.org/questions/programming-9/file-system-indexing-4175511016/)

ddc 07-14-2014 01:41 AM

file system indexing
 
Hi all,

I need to search for a particular directory without iterating children/comparing directory names on Linux.

Does Linux maintains file system indexer like spotlight on mac. Search has to finish in button click event.

any solution?

Thanks,
dc

looop 07-14-2014 01:47 AM

Just use find or locate, you have to update the index, with 
Code:

sudo updatedb
. Though I do think that locate and find are both recursive but I am not certain

ddc 07-14-2014 01:59 AM

Thank you.

interesting.

Is it possible to use this in C++ desktop application? Is it possible to open mlocate.db? What kind of database it is.

looop 07-14-2014 02:03 AM

Well I asume, yes depends on how you want the out, you can invoke system commands in C++.
But do you want the string reply? or how do you want it representated ?



Remember to thank post, which helps you :)

ddc 07-14-2014 02:32 AM

I need the output in string only. First occurrence of directory path.

NevemTeve 07-14-2014 02:42 AM

> I need to search for a particular directory without iterating children/comparing directory names on Linux. Search has to finish in button click event.

You might want to get this information at once, but it still might be impossible. The usual method is start a background thread (or activate a pre-created background thread) when the user presses the button, and show the result when it is available.

looop 07-14-2014 02:45 AM

Check this SO thread: http://stackoverflow.com/questions/4...mmand-within-c

First answer should tell you what to do


All times are GMT -5. The time now is 04:28 PM.