I am writing a Python script to create an array and load data into it using the scidb dense load format file:

[code] absPath = os.path.abspath(“test.csv”)

absPath2= os.path.abspath("test.scidb")

print '\nPreaparing the load file...'
os.popen("csv2scidb -s 1 < "+absPath+" > "+absPath2)

print '\nLoading data from load file into testFlat array...'
os.popen('iquery -q "LOAD testFlat FROM \''+absPath2+'\';"')[/code]

Things happen smoothly on the command line but the script fails with the following error message:

UserException in file: src/smgr/io/DBLoader.cpp function: checkStreamError line: 195 Error id: scidb::SCIDB_SE_DBLOADER::SCIDB_LE_FILE_WRITE_ERROR Error description: Error in loader. Failed to write file: 1.
I suspected that the dense load file is not completely written before I try to read it in the load command. So I also tried adding a time.sleep(t) between csv2scidb and LOAD. First 10 seconds, then 20, then 30. Still continue to get the same error…


Using os.system() instead of os.popen() for the LOAD command resolved this issue for me.


We are relieved.