use correct method to write raw data
close file
fix edfs allocation