Hi,
I have built relevance to search inside a file and look for a certain string of characters. it works great, except it is case sensitive, and I do not want it to be. Unfortunately, the case could be found either all upper, all lower, or mixed case. I want the relevance to find it no matter what the case, but I cannot seem to find the code. Here is the relevance as it stands today, but want to add that case does not matter. . .
Do you want your relevance to return machines that do have the file, but don’t have that entry, or do you want it also to return machines that don’t have the file at all?
This should be faster:
not exists files "C:\Backup\TSM\baclient\dsm.opt" whose(contents of it as lowercase contains "oracleagent")
Take a look at these related items for Tivoli Storage Manager:
All of our machines have that file (I did check that using separate relevance just to be sure that part worked). So now I only want to know what machines don’t have the words ‘oracleagent’ in that file (in any case).
It seems in the relevance debugger the code you gave works, but when i put it into a new task, some servers show relevant (as NOT having those words in the file), but when I look at the file, i find those words in there. . . . but not on all of them. Maybe I just need to let it ‘cook’ for a while and check later. Anyway, thanks for your input on this.
The exists might also give you some interesting results if the file is locked etc. We probably should add something that indicates you can open it. We do try to open a file with the READ_SHARE bits turned on but some applications don’t have the file open in a sharable way or its open for exclusive write.
There are cases that aren’t covered yes. If a file is open WRITE_SHARED we currently don’t open it as the contents are changing. Its a topic for discussion and something that would be nice to get around.
I don’t believe even Notepad++ though can open a file that is opened for exclusive write though.