withFile package:system-fileio

Open a file in binary mode, and pass its Handle to a provided computation. The Handle will be automatically closed when the computation returns. This computation throws IOError on failure. See “Classifying I/O errors” in the System.IO.Error documentation for information on why the failure occured.