Page 1 of 1

SC Quicksearch() returns corrupted string

Posted: 13 Nov 2015 22:11
by Papoulka
OK, this has nothing to do with fuzzy search, although I am using that. It's on a plain Windows 7 32-bit PC with 4GB RAM, not a virtual machine. XY v15.90.0028 ::fresh.

I have a large external USB drive "R:". Path "R:\target\" there has 5300 first-level folders. The folder names average ~50 chars long. My script, described here in simplified form, reads each folder name from that path and creates a new empty folder in path "G:\dumfold\" with the same name. G: is an internal SSD.

There is a match name $selbase, which I here set to "selbase". Then I use quicksearch() to search through G:\dumfold\ for target folders that come close to matching "selbase".

Here's the code, minus some irrelevant (I think) details:

Code: Select all

 $dumfold = "G:\dumfold";
 $trgpath = "R:\target";
 $trgpathlst = folderreport("dirsrel", r, $trgpath, , , "|");
 foreach ($targ, $trgpathlst, "|", e) {new("$dumfold\$targ", dir);}
 $selbase = "selbase";
 $targmbe = quicksearch("$selbase /n/d/fuzzy=30", $dumfold, "|");
THE PROBLEM is that the quicksearch result string "$targmbe" sometimes contains not only a few fuzzy-matched folder names from G:\dumfold\ (which is what I expect), but also, following those, the entire 5300-folder list of R:\target (with full R:... path info).

Since the quicksearch knows nothing at all about R:, my guess is that the very long strings involved (260K chars) cause an XY memory pointer to get confused. So the problem may not be with QS itself, but that's how it shows up here.

This happens repeatably in my script, when the QS match attempt follows the renaming of a folder in R:\target\. The rename would have resulted from the prior match attempt. So overall, my script successfully finds one match and renames an folder in R:\target, but on the next match attempt (the value of $selbase having been changed) quicksearch returns the junk string.

[Edit] The problem does not occur if the R:\target\ path has 1000 folders instead of 5300.

Re: SC Quicksearch() returns corrupted string

Posted: 14 Nov 2015 10:57
by admin
Not being on your system I cannot reproduce this, of course.

Please isolate the script line which returns the corrupted string, with all its parameters, and the corrupted string itself (or at least a part of it).