LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-14-2014, 01:41 AM   #1
ddc
LQ Newbie
 
Registered: Jul 2014
Posts: 13

Rep: Reputation: Disabled
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
 
Old 07-14-2014, 01:47 AM   #2
looop
Member
 
Registered: Oct 2011
Location: Denmark
Distribution: Slackware - Mac OS X Lion - RedHat 6 - MS Win 2003 server - A/UX - FreeBSD - FreeNAS - pfsense
Posts: 75

Rep: Reputation: Disabled
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
 
1 members found this post helpful.
Old 07-14-2014, 01:59 AM   #3
ddc
LQ Newbie
 
Registered: Jul 2014
Posts: 13

Original Poster
Rep: Reputation: Disabled
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.
 
Old 07-14-2014, 02:03 AM   #4
looop
Member
 
Registered: Oct 2011
Location: Denmark
Distribution: Slackware - Mac OS X Lion - RedHat 6 - MS Win 2003 server - A/UX - FreeBSD - FreeNAS - pfsense
Posts: 75

Rep: Reputation: Disabled
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
 
Old 07-14-2014, 02:32 AM   #5
ddc
LQ Newbie
 
Registered: Jul 2014
Posts: 13

Original Poster
Rep: Reputation: Disabled
I need the output in string only. First occurrence of directory path.
 
Old 07-14-2014, 02:42 AM   #6
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 3,563

Rep: Reputation: 1092Reputation: 1092Reputation: 1092Reputation: 1092Reputation: 1092Reputation: 1092Reputation: 1092Reputation: 1092
> 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.
 
Old 07-14-2014, 02:45 AM   #7
looop
Member
 
Registered: Oct 2011
Location: Denmark
Distribution: Slackware - Mac OS X Lion - RedHat 6 - MS Win 2003 server - A/UX - FreeBSD - FreeNAS - pfsense
Posts: 75

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

First answer should tell you what to do
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Tab-Completion in bash indexing system folders! dvno00 Linux - General 2 11-15-2010 11:02 PM
recoll indexing error while indexing Mail/ [SOLVED] ajnabi Linux - Software 1 09-14-2009 12:44 AM
Indexing text file Deepak Inbasekaran Programming 7 04-19-2006 07:18 AM
File indexing - Best program to use? IMSargon Linux - Software 2 04-02-2006 02:59 PM
File indexing question kfaday Programming 1 09-08-2004 07:53 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration