io: functions for moving message data to/from regular files