Changeset 22124

Show
Ignore:
Timestamp:
19.05.2010 20:48:22 (9 years ago)
Author:
ak19
Message:

JDBM works on Windows now: Dr Bainbridge fixed the Java code by commenting out calls to system.err which were creating DOS prompts that wouldn't exit. Will need to redirect the output eventually, but am committing this working version (since in the early commit containing the USE_GDBM and USE_JDBM changes for Windows, only GDBM was working). Have now tested combinations of both flags in separate SVN checkouts, both with LOCAL_LIBRARY and APACHE_HTTPD turned on during compilation.

Location:
main/trunk/greenstone2/common-src/src/jdbmedit
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/common-src/src/jdbmedit/JdbGet.java

    r21403 r22124  
    5959    public static void main(String[] args) 
    6060    { 
     61    //System.err.println("Running JdbmEdit"); 
    6162 
    6263    if (args.length != 2) { 
     
    6768    String key    = args[1]; 
    6869 
     70    //System.err.println("Args: " + args[0] + " " + args[1]); 
     71 
    6972        try { 
    7073 
    7174            JdbmAPI jdbm_api = new JdbmAPI(dbname,true); 
     75        //System.err.println("Constructed jdbm_api"); 
    7276            String val = jdbm_api.get(key); 
    7377        utf8out.println(val); 
  • main/trunk/greenstone2/common-src/src/jdbmedit/JdbmAPI.java

    r22040 r22124  
    7777 
    7878    if (recid != 0) { 
    79         System.err.println("# Loading existing database table '" + TNAME +"' ..."); 
     79        //      System.err.println("# Loading existing database table '" + TNAME +"' ..."); 
    8080        hashtable_ = HTree.load(recman_, recid); 
    8181    } 
     
    8484        if (must_exist) { 
    8585        recman_.close(); 
    86         System.err.println("Database table '" + TNAME +"' does not exist."); 
     86        //      System.err.println("Database table '" + TNAME +"' does not exist."); 
    8787        throw new IOException(); 
    8888        } 
    8989        else { 
    90         System.err.println("# No database table '" + TNAME +"' to set.  Creating new one"); 
     90        //      System.err.println("# No database table '" + TNAME +"' to set.  Creating new one"); 
    9191        hashtable_ = HTree.createInstance(recman_); 
    9292        recman_.setNamedObject(TNAME, hashtable_.getRecid()); 
     
    159159    { 
    160160    recman_.close(); 
    161     System.err.println("# Done"); 
     161    //  System.err.println("# Done"); 
    162162    } 
    163163 
     
    173173    } 
    174174    if (c != '\n') { 
    175         System.err.println("JdbmAPI: Warning, expected end-of-line character, but encountered '" + (char)c + "' ord(" + c + ")"); 
     175        //      System.err.println("JdbmAPI: Warning, expected end-of-line character, but encountered '" + (char)c + "' ord(" + c + ")"); 
    176176    } 
    177177    } 
     
    248248            } 
    249249            else { 
    250             System.err.println("JdbmAPI: Command '" + cmd + "'ended prematurely"); 
     250            //          System.err.println("JdbmAPI: Command '" + cmd + "'ended prematurely"); 
    251251            encountered_error = true; 
    252252            break; 
     
    259259            String vallen_str = brin.readLine(); 
    260260            if (vallen_str==null) { 
    261             System.err.println("JdbmAPI: Command '" + cmd + "'ended prematurely"); 
     261            //          System.err.println("JdbmAPI: Command '" + cmd + "'ended prematurely"); 
    262262            encountered_error = true; 
    263263            break; 
     
    269269             
    270270            if (valbuffer.length==0) { 
    271             System.err.println("JdbmAPI: Command '" + cmd + "'ended prematurely"); 
     271            //          System.err.println("JdbmAPI: Command '" + cmd + "'ended prematurely"); 
    272272            encountered_error = true; 
    273273            break; 
     
    284284        } 
    285285        else { 
    286             System.err.println("JdbmAPI: Unrecognised command '" + cmd + "'"); 
     286            //          System.err.println("JdbmAPI: Unrecognised command '" + cmd + "'"); 
    287287            encountered_error = true; 
    288288        }