Safer I/O