io.file improvements: context preservation