@jlee-r7 @jvazquez-r7  I have two questions about the store_loot in this case:
1- When the file is not resident, I have to store small chunks of data to disk (take a look at save_file function). I can not read all data in a buffer and then save it on disk. That's why I used File.open in append mode. Is any way of doing that with store_loot

2- When the file is resident, since I don't know the type of the data beforehand, what ctype should I used?