public static final ArrayList <String> search_loadcache(int depth)
{
    ArrayList <String> v;
    File f;
    long scantime;
    long filetime;
    String s;

    v=null;
    f=new File(mgr.cache_dir+File.separatorChar+SEARCHCACHE+depth+".tmp");
    if(!f.exists()) return null;

    try
    {
    	DataInputStream din=new DataInputStream(
    						new BufferedInputStream(
    						new FileInputStream(f),4096)
    	);
    	if(!SEARCHCACHEMAGIC.equals(din.readUTF()))
    	{
    		// System.out.println("/debug/ searchcache has bad magic");
    		return null; // no magic
    	}
    	if(File.separatorChar!=din.readChar())
    	{
    		// cache from non-compatible OS
    		// System.out.println("/debug/ searchcache from other OS");
    		return null;
    	}
    	scantime=din.readLong();
    	filetime=f.lastModified();
    	long now=System.currentTimeMillis();
    	if(filetime+minsearchcachettl<now)
    		if(filetime+scantime*searchcachefactor < now)
    		{
    			// System.out.println("/debug/ searchcache has expired");
    			return null;  // expired
    		}

    	v=new ArrayList<String> (100);
    	while(true)
    	{
    		s=din.readUTF();
    		if(s.length()==0) break;
    		v.add(s);
    	}
    	din.close();
    }
    catch (IOException ignore)
    {
    	// System.out.println("/debug/ error reading searchcache");
    }

    return v;
}