AutoHotkey Community

It is currently May 24th, 2012, 5:34 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 36 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject:
PostPosted: February 6th, 2007, 7:03 am 
Offline

Joined: October 9th, 2004, 8:55 pm
Posts: 217
Location: Budapest, Hungary
Demetris wrote:
Maybe it was the same in the previous version. I did not look for any Greek file names until now. The thing is, I pasted the newer version over it and now I cannot diff them. :-) I you still have yesterday's version, I can check for you.

Nope, I don't have it anymore (that version was not yet under version control), but if you didn't try that with Greek file names then I assume the result would be the same.

Demetris wrote:
But here is something strange. I made two test files:

aaaa.txt
aaaâ.txt

Locate32 finds both. So does locate.ahk when I look for aaa txt, but it displays the a circumflex as a Greek beta [β] :?

I have no idea why this is. Maybe you should post a question in the Help section to find out if there are issues with ListView and international characters. (I don't know why it works in 320mph.)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 6th, 2007, 9:31 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Quote:
Does the window disappear if you simply type something without pressing Enter?

Only when I press Enter, script exits. While I type nothing happens...

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 6th, 2007, 9:35 am 
Offline

Joined: October 9th, 2004, 8:55 pm
Posts: 217
Location: Budapest, Hungary
Is the path to locate32 set properly? Does it work from the command line?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 6th, 2007, 10:14 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Ok, it works... it seems somtimes redirection finish as an empty file in TEMP dir but other then that it works...


Just one question. Why did you execute serries of locate runs for eatch folder?

Code:
search_for_pattern(pattern, UserProfile . "\Recent", now)
search_for_pattern(pattern, a_startmenu, now)
search_for_pattern(pattern, a_startmenucommon, now)
search_for_pattern(pattern, "")


Why don't u execute everything at once using multple -p parameters in the manner :

Code:
search_for_pattern( pattern, dir1 | dir2 | ... dirN, now)


and construct command with -p dir1 -p dir2 ....

I imagine you put it as last folder will be searched the longest, so you wanted to have resultas from common places ASAP. If so, are you sure that multiple locate executions per pattern are faster then single with directory array?

EDIT: Well, I tried searching evrything at once at it does the things faster here. This changes application as it will have different order of search results though...

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 6th, 2007, 11:32 am 
Offline

Joined: August 5th, 2005, 6:31 pm
Posts: 16
keyboardfreak wrote:
Demetris wrote:
But here is something strange. I made two test files:

aaaa.txt
aaaâ.txt

Locate32 finds both. So does locate.ahk when I look for aaa txt, but it displays the a circumflex as a Greek beta [β] :?

I have no idea why this is. Maybe you should post a question in the Help section to find out if there are issues with ListView and international characters. (I don't know why it works in 320mph.)

Just a guess:

Since it does display Greek characters (instead of aaaâ.txt, which is a Unicode filename in my setup, it shows aaaβ.txt), and since I've never seen anything similar with AHK and Greek filenames, maybe it is something in the way the results pass from Locate32 to locate.ahk...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 6th, 2007, 1:54 pm 
Offline

Joined: October 9th, 2004, 8:55 pm
Posts: 217
Location: Budapest, Hungary
majkinetor wrote:
Why don't u execute everything at once using multple -p parameters in the manner :

Code:
search_for_pattern( pattern, dir1 | dir2 | ... dirN, now)


and construct command with -p dir1 -p dir2 ....

I simply didn't know -p can be given multiple times for locate. Thanks, I'll look into it.

majkinetor wrote:
I imagine you put it as last folder will be searched the longest, so you wanted to have resultas from common places ASAP.

No, I put it last, so that those results come after the common ones.

majkinetor wrote:
EDIT: Well, I tried searching evrything at once at it does the things faster here. This changes application as it will have different order of search results though...

Well, the order of search results is an important feature, so if it cannot be guaranted with a single search then the slight performance gain doesn't justify the changes you suggest.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 6th, 2007, 1:58 pm 
Offline

Joined: October 9th, 2004, 8:55 pm
Posts: 217
Location: Budapest, Hungary
Demetris wrote:
Since it does display Greek characters (instead of aaaâ.txt, which is a Unicode filename in my setup, it shows aaaβ.txt), and since I've never seen anything similar with AHK and Greek filenames, maybe it is something in the way the results pass from Locate32 to locate.ahk...

Currently, the results are redirected into a file and read from it when the search is finished. Maybe you could check the output file (%A_Temp%\loc.out) if the characters are correct there.

If not then you can try replacing the file redirection with CmdRet (I think that's the name of the function which avoids using temporary files) in the script and see if it helps.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 6th, 2007, 2:15 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Quote:
Well, the order of search results is an important feature, so if it cannot be guaranted with a single search then the slight performance gain doesn't justify the changes you suggest.


Maybe it displayas result in the order of folders that are set.... Anyway, U can take all common folders in one shot, then everything after, it will still be faster then 4 calls.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 6th, 2007, 3:24 pm 
Offline

Joined: August 5th, 2005, 6:31 pm
Posts: 16
keyboardfreak wrote:
Demetris wrote:
Since it does display Greek characters (instead of aaaâ.txt, which is a Unicode filename in my setup, it shows aaaβ.txt), and since I've never seen anything similar with AHK and Greek filenames, maybe it is something in the way the results pass from Locate32 to locate.ahk...

Currently, the results are redirected into a file and read from it when the search is finished. Maybe you could check the output file (%A_Temp%\loc.out) if the characters are correct there.

If not then you can try replacing the file redirection with CmdRet (I think that's the name of the function which avoids using temporary files) in the script and see if it helps.

OK. I checked loc.out, and the characters are not correct there either.

I would try CmdRet, but I don't understand how to use it. :-( (I think this stuff is over my head...)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 6th, 2007, 8:52 pm 
Offline

Joined: October 9th, 2004, 8:55 pm
Posts: 217
Location: Budapest, Hungary
Demetris wrote:
I would try CmdRet, but I don't understand how to use it. :-( (I think this stuff is over my head...)

Okay, then apply these changes (and of course add the CmdRet function too) and let me know if it helped.

Note that it's a quick hack, so there will be errors in the search results, but if it works for you then I'll implement it properly.
Code:
 ; comment out these two lines and add the third after them
 ;  RunWait, %comspec% /c ""%LOCATE_PATH%" %LOCATE_OPTIONS% %directory% %pattern% > "%output_file%"",, Hide UserErrorLevel

 ; FileRead, Contents, %output_file%
  Contents := CMDret_RunReturn(comspec . " /c """ . LOCATE_PATH . """ " . LOCATE_OPTIONS . " " . directory . " " . pattern)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 7th, 2007, 12:12 pm 
Offline

Joined: August 5th, 2005, 6:31 pm
Posts: 16
Still question marks ! :-)

I hope I used the correct CmdRet function, the one by corrupt here.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 7th, 2007, 7:16 pm 
Offline

Joined: October 9th, 2004, 8:55 pm
Posts: 217
Location: Budapest, Hungary
  • Fixed filtering of duplicate files out of search results.
  • Directory-constrained searches are done in one step to avoid running locate multiple times. (Thanks majkinetor)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 7th, 2007, 7:17 pm 
Offline

Joined: October 9th, 2004, 8:55 pm
Posts: 217
Location: Budapest, Hungary
Demetris wrote:
Still question marks ! :-)

Then I'm officially out of ideas. You have to look for someone smarter than me to solve the problem. :D


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 7th, 2007, 8:07 pm 
Offline

Joined: August 5th, 2005, 6:31 pm
Posts: 16
OK. Thanks! :-) Let’s hope someone will be able to solve this.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 7th, 2007, 11:37 pm 
Offline

Joined: February 17th, 2005, 10:06 am
Posts: 280
Location: Hungary, Budapest
A more reliable way to find out Total Commander's path is to use the %COMMANDER_PATH% variable.

_________________
Is there another word for synonym?


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 36 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Alpha Bravo, Exabot [Bot], IsNull, nothing, trismarck, Yahoo [Bot] and 20 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group