Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Interesting utilities

Reply
Thread Tools

Interesting utilities

 
 
jacob navia
Guest
Posts: n/a
 
      10-11-2011
I am developing in the Mac OS X (10.7) system, and it has some nice
features that I hadn't seen in any windows/unix system.

One of them is the "mdfind" utility that is incredibly powerful:

mdfind some-identifier

will look in the whole machine for "some-identifier" and write you in
standard output the name of all files that have a match. It is like

grep -R "some-identifier" /*.*

but it comes back in seconds instead of hours like grep.

It is very useful, and I never found something even remotely equivalent
under linux/sun os

Another nifty thing is the splint code checker. (This one is probably
present under linux also but I never saw it under windows)

The problem with it is that it is incredibly verbose, swamping the
few interesting diagonstics under a mountain of rubbish. After a long
session with it I have trimmed it to give me reasonable short output.

I put all options in a shell script:

/bin/sh
splint -formatconst -dependenttrans -globstate -compdef -mayaliasunique
-paramuse +boolint -immediatetrans -retvalother -noeffect
-unqualifiedtrans -compdestroy -temptrans -branchstate -usereleased
-kepttrans -compmempass -nullstate -nullpass -nullret -boolops
-mustfreeonly -incondefs +charint -retvalint -predboolint -realcompare $1

 
Reply With Quote
 
 
 
 
Roberto Waltman
Guest
Posts: n/a
 
      10-15-2011
jacob navia wrote:
>I am developing in the Mac OS X (10.7) system, and it has some nice
>features that I hadn't seen in any windows/unix system.
>
>mdfind some-identifier ...
>but it comes back in seconds instead of hours like grep.


That probably means that it looks into a keyword database, built by
indexing the files in the background, over many hours instead of
seconds.
And yes, the same functionality is available under Linux and Windows.

>Another nifty thing is the splint code checker. (This one is probably
>present under linux also but I never saw it under windows)


A windows installer is available at the home page:
http://www.splint.org/

--
Roberto Waltman

[ Please reply to the group,
return address is invalid ]
 
Reply With Quote
 
 
 
 
jacob navia
Guest
Posts: n/a
 
      10-15-2011
Le 15/10/11 06:35, Roberto Waltman a écrit :
> jacob navia wrote:
>> I am developing in the Mac OS X (10.7) system, and it has some nice
>> features that I hadn't seen in any windows/unix system.
>>
>> mdfind some-identifier ...
>> but it comes back in seconds instead of hours like grep.

>
> That probably means that it looks into a keyword database, built by
> indexing the files in the background, over many hours instead of
> seconds.
> And yes, the same functionality is available under Linux and Windows.



Sorry but I have never even heard about something like that under
windows/linux.
Maybe you have an example?

>
>> Another nifty thing is the splint code checker. (This one is probably
>> present under linux also but I never saw it under windows)

>
> A windows installer is available at the home page:
> http://www.splint.org/
>


Thanks, I overlooked that one.
 
Reply With Quote
 
Geoff
Guest
Posts: n/a
 
      10-15-2011
On Sat, 15 Oct 2011 13:06:46 +0200, jacob navia <>
wrote:

>Sorry but I have never even heard about something like that under
>windows/linux.
>Maybe you have an example?


It's called Spotlight on OS/X and Windows Search since the release of
Windows XP. I can't remember what it was called in Windows 2000.
Settings are available in the Windows Control panel applet named
"Indexing Options" on Windows 7.
 
Reply With Quote
 
Roberto Waltman
Guest
Posts: n/a
 
      10-15-2011
jacob navia wrote:

[ re: File indexing / search applications ]
> ... something like that under
>windows/linux.
>Maybe you have an example?


http://en.wikipedia.org/wiki/Windows_Search
http://www.microsoft.com/download/en/details.aspx?id=23
http://www.vandenoever.info/software...kademy2006.pdf
http://www.wikinfo.org/index.php/Com...earch_software
http://en.wikipedia.org/wiki/Beagle_%28software%29

The last page says the Beagle project, (only one I used under Linux,)
is not being developed anymore. I was not aware of that.

--
Roberto Waltman

[ Please reply to the group,
return address is invalid ]
 
Reply With Quote
 
Kaz Kylheku
Guest
Posts: n/a
 
      10-16-2011
On 2011-10-11, jacob navia <> wrote:
> I am developing in the Mac OS X (10.7) system, and it has some nice
> features that I hadn't seen in any windows/unix system.
>
> One of them is the "mdfind" utility that is incredibly powerful:
>
> mdfind some-identifier
>
> will look in the whole machine for "some-identifier" and write you in
> standard output the name of all files that have a match. It is like
>
> grep -R "some-identifier" /*.*
>
> but it comes back in seconds instead of hours like grep.


So it is not more powerful than grep, since it computes the same thing. The
word you are looking for is "faster".

Can it find any regular expression in seconds?

> It is very useful, and I never found something even remotely equivalent
> under linux/sun os


How hard do you look?

I use id-utils and ctags for doing this over programming projects.
In id-utils there is a "mkid" utility which indexes the identifiers found
in a directory tree. This is gathered into a big file called ID.
The ID file is queried with "lid".

I just set up an Ubuntu system where "apt-get install id-utils"
got me mkid in seconds.

> Another nifty thing is the splint code checker. (This one is probably
> present under linux also but I never saw it under windows)


There is a direct pointer to a Windows download page on the Splint
home page! This kind of thing is not going to come preinstalled on a Wintel PC
from Best Buy.

> The problem with it is that it is incredibly verbose, swamping the
> few interesting diagonstics under a mountain of rubbish. After a long
> session with it I have trimmed it to give me reasonable short output.


This is by design. To get value out of splint you have to read the
documentation and start using the annotations.

Splint can statically check things like that malloced objects are freed
somewhere, at least for some programs (maybe not in general).
 
Reply With Quote
 
Kaz Kylheku
Guest
Posts: n/a
 
      10-16-2011
On 2011-10-15, jacob navia <> wrote:
> Le 15/10/11 06:35, Roberto Waltman a écrit :
>> jacob navia wrote:
>>> I am developing in the Mac OS X (10.7) system, and it has some nice
>>> features that I hadn't seen in any windows/unix system.
>>>
>>> mdfind some-identifier ...
>>> but it comes back in seconds instead of hours like grep.

>>
>> That probably means that it looks into a keyword database, built by
>> indexing the files in the background, over many hours instead of
>> seconds.
>> And yes, the same functionality is available under Linux and Windows.

>
> Sorry but I have never even heard about something like that under
> windows/linux.
> Maybe you have an example?


http://freshmeat.net/search?q=file+i...&submit=Search

45 hits, some of them relevant-looking.

http://freshmeat.net/search?q=file+search&submit=Search

251 hits.

Man, you really are still a goof, sorry to say.

Windows has dynamic file indexing since Vista, if not before.
 
Reply With Quote
 
Ian Collins
Guest
Posts: n/a
 
      10-16-2011
On 10/16/11 02:18 PM, Kaz Kylheku wrote:
> On 2011-10-11, jacob navia<> wrote:
>> I am developing in the Mac OS X (10.7) system, and it has some nice
>> features that I hadn't seen in any windows/unix system.
>>
>> One of them is the "mdfind" utility that is incredibly powerful:
>>
>> mdfind some-identifier
>>
>> will look in the whole machine for "some-identifier" and write you in
>> standard output the name of all files that have a match. It is like
>>
>> grep -R "some-identifier" /*.*
>>
>> but it comes back in seconds instead of hours like grep.

>
> So it is not more powerful than grep, since it computes the same thing. The
> word you are looking for is "faster".
>
> Can it find any regular expression in seconds?
>
>> It is very useful, and I never found something even remotely equivalent
>> under linux/sun os

>
> How hard do you look?
>
> I use id-utils and ctags for doing this over programming projects.
> In id-utils there is a "mkid" utility which indexes the identifiers found
> in a directory tree. This is gathered into a big file called ID.
> The ID file is queried with "lid".
>
> I just set up an Ubuntu system where "apt-get install id-utils"
> got me mkid in seconds.


These utilities are all well and good on a relatively static filesystem,
but the fun begins when you want to keep the database as up to date as
possible.

I know all about the fun involved, I have to maintain an index over a
couple of multi-TB filesystems with tens of millions of files in each!

--
Ian Collins
 
Reply With Quote
 
Kaz Kylheku
Guest
Posts: n/a
 
      10-16-2011
On 2011-10-16, XeCycle <> wrote:
> jacob navia <> writes:
>> It is very useful, and I never found something even remotely
>> equivalent under linux/sun os

>
> What about `locate' from GNU Findutils?


Locate searches only file names, not their contents.

That's been a staple of Linux distros as far as I can remember (which could
potentially takes us back as far as 1993).

Long before operating systems "for the rest of them" started getting
any kind of indexing.
 
Reply With Quote
 
jacob navia
Guest
Posts: n/a
 
      10-16-2011
Le 16/10/11 03:24, Kaz Kylheku a écrit :
> On 2011-10-15, jacob navia<> wrote:
>> Le 15/10/11 06:35, Roberto Waltman a écrit :
>>> jacob navia wrote:
>>>> I am developing in the Mac OS X (10.7) system, and it has some nice
>>>> features that I hadn't seen in any windows/unix system.
>>>>
>>>> mdfind some-identifier ...
>>>> but it comes back in seconds instead of hours like grep.
>>>
>>> That probably means that it looks into a keyword database, built by
>>> indexing the files in the background, over many hours instead of
>>> seconds.
>>> And yes, the same functionality is available under Linux and Windows.

>>
>> Sorry but I have never even heard about something like that under
>> windows/linux.
>> Maybe you have an example?

>
> http://freshmeat.net/search?q=file+i...&submit=Search
>
> 45 hits, some of them relevant-looking.
>
> http://freshmeat.net/search?q=file+search&submit=Search
>
> 251 hits.
>
> Man, you really are still a goof, sorry to say.
>
> Windows has dynamic file indexing since Vista, if not before.


Sure, but it doesn't index everything, as I have seen lately.
Only some selected directories. SUre you can change that but still,
it doesn't match the easy of use of not doing anything


I used the find utility in windows XP, and the terrible interface
with the dog just convinced me to avoid it completely. In any case it
wasn't a background process as it is in the mac


Under linux there *could* be an indexing utility around of course,
but it is not automatic like mdfind.

What is interesting in the mac is the number of automatic utilities
like mdfind, for instance the indredibly useful backup utility, that
work out of the box without any need for big configurations, etc.

 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing Browser Utilities on LinkSys WAP11 Doug Miannay Wireless Networking 1 04-18-2005 06:51 AM
Ant Utilities? Marcus Leon Java 1 02-04-2005 10:35 PM
Integerating Unix pipes with Swing Utilities Ganesh Java 4 01-31-2005 12:14 PM
HTML text filters, display control, utilities _eee_ ASP .Net 3 02-28-2004 10:58 PM
Cisco Tools & Utilities JohnNews Cisco 3 10-28-2003 10:38 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57