 
 
           os.mkdir TEMP_DIR
-          fd = fs.openSync(PATH + LOCATIONS_TEMP_FILE, 'w')
+          fd = fs.openSync(LOCATIONS_TEMP_FILE, 'w')
           for r in result.rows
             fs.writeSync fd, JSON.stringify(r) + "\n"
           fs.closeSync fd

                "-d aiddata -c #{collection} --upsert --upsertFields #{upsertFields.join(',')} " +
                "-u #{dbconf.mongodb.user} -p #{dbconf.mongodb.password} "+ 
                "#{file}"
    console.log "Running in \"#{__dirname}\":\n#{cmd}"
    os.run cmd,
      (err) ->

pg = require 'pg'
pgurl = dbconf.postgres

DEBUG_updateRowsLimit = 10   # set for debugging
OMIT_NULL_VALUE_FIELDS_IN_COMMITMENTS_JSON = false
 
PATH = "data/imports/"
TEMP_DIR = "temp"
AIDDATA_TEMP_FILE = PATH + TEMP_DIR + "/aiddata.json"
LOCATIONS_TEMP_FILE = PATH + TEMP_DIR + "/locations.json"

USE_MONGOIMPORT = true

