A short update: The script mentioned now runs on my side under CygWin successfully. However it probably is of no help for others, except for looking how I did it, as I had no time to create a python script, so it was quickly put together with bash and awk plus some of my own shell-tools. If somebody is interested anyway please send an eMail, the script itself is CLL, so not copyrighted, and therefor I will distribute it freely.
It works as follows: It takes the files written by Gears localserver out of the old location and moves them into a new location numbered MMM/KKK/FILE where MMM is the ID/1000000 and KKK is the ID/1000%1000. It also updates the database records accordingly. Now after some thousand of files are added I run the script to cleanup the localserver directory but keep the files accessible offline by gears. The script is not perfect, as it sometimes leaves behind some files if run concurrently to FF (else DB transaction would slow down everything extremely), also it does not clean up abandoned directories yet. The only problem left seems to be that FF slowstarts the localserver as Gears seems to run through all database entries once at startup. However afterwards everything is back to normal without delays imposed by incomprehensibly long paths. Currently I have over 90K files cached in a single localserver and the DB uses around 1K per record. The script itself is prepared to work up to 1G files, however I think before reaching this the SQLite DB of Gears will slow down the FF startup beyond the time left for this universe. However I expect that 10M files can be done on my laptop now with some additional tricks. Note that I do not think this hack is compatible to localserver function removeStore, and resource functions remove, rename, copy. (I did not check that ever.) -Tino
