     console.log "> Export aiddata commitments from PostgreSQL to a temporary file"
 
     os.mkdir TEMP_DIR
-    fd = fs.openSync(PATH + AIDDATA_TEMP_FILE, 'w')
+    fd = fs.openSync(AIDDATA_TEMP_FILE, 'w')
 
     query = pgclient.query "SELECT * FROM aiddata2 #{if DEBUG_updateRowsLimit? then 'LIMIT '+DEBUG_updateRowsLimit}"
     query.on 'row', (row) ->

  q = queue(1)  # no parallelism
  tasks.forEach (t) -> q.defer t
  q.await callWhenEnded


runTasksSerially [

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

