debug file save-read functions