kingandy: (Frowny)
kingandy ([personal profile] kingandy) wrote2005-06-06 02:26 pm

Why Windows is shit today

http://www.pcplus.co.uk/tips/default.asp?pagetypeid=2&articleid=5870&subsectionid=390

The "Containing Text" field of the built-in Windows XP search system only works on extensions it recognises[1]. Unless you tell it to search everything, which is an option hidden in the File Indexing service - which doesn't even have to be turned on, but the option has to be set inside it anyway.

I mean, what the fuck.

[1] In theory this is so that the system doesn't waste your time, say, looking through image files for some text. Of course any reasonable person would tell it "don't search these files" rather than "only search these other files". Quite apart from the fact that there are people out there who genuinely want to search through image files for specific characters, it's annoying because apparently ASP and PHP aren't on the list of approved file types. Because whoever would want to look for text inside one of those?

Extensions suck...

[identity profile] stsquad.livejournal.com 2005-06-06 02:14 pm (UTC)(link)
...as a way to determine file type. I like the magic number approach so much better:

15:13 alexjb@okra [dotfiles] >file ~/mysrc/c/binmerge/binmerge.c
/home/alexjb/mysrc/c/binmerge/binmerge.c: ASCII C program text
15:13 alexjb@okra [dotfiles] >file ~/mysrc/dotfiles/dotbashrc
/home/alexjb/mysrc/dotfiles/dotbashrc: Bourne-Again shell script text

Re: Extensions suck...

[identity profile] stsquad.livejournal.com 2005-06-06 02:17 pm (UTC)(link)
Which of course makes searching all files which contain text an easy* case of:

find ~/mysrc/ -xtype f | xargs file | grep "text" | perl -ne 'm/(.*):/; print "$1\n";' | xargs grep "what I look for"


*easy being by definition, didn't need to think hard about that, rather than looks pretty on the screen.

Re: Extensions suck...

[identity profile] stsquad.livejournal.com 2005-06-06 02:30 pm (UTC)(link)
"conscious decision"

Well its a failing of the GUI as a user interface. Yes they are easy to pick up, but its quite easy to go beyond the bounds of what the UI designers planned for, especially if your an advanced user. I run in a GUI environment here and at home but you can take the command line out of my cold dead fingers. Its just too useful.

You can of course install Cygwin on your machine if you want the command line power of Un*x on Windows.

Re: Extensions suck...

[identity profile] stsquad.livejournal.com 2005-06-06 02:37 pm (UTC)(link)
Yeah, but findutils is a search engine. You also get slocate thrown in for free.
icklejo: (Default)

[personal profile] icklejo 2005-06-06 10:20 pm (UTC)(link)
Yes, it's a pain in the arse. We use .jtp and .jphtml files at work, which are basically html files. Not that the search mechanism bothers to notice this as you say.