Use root constant to handle different current working directories.  Use block form of open to ensure file is closed on error.