fix file buffering, add method to dump file to ceph