# # # patch "ChangeLog" # from [d7a13100a506b347c766e75306666276d8b0a2c9] # to [d5f15ea69b36d3b49dd6c2e3f3b0c4724bd7a45d] # # patch "tester.lua" # from [5c7149203f3d3735c07ccc7fd348672bd6a50d27] # to [66cae018a22f78d18c2f340e76c2c72b5040f3cd] # ============================================================ --- ChangeLog d7a13100a506b347c766e75306666276d8b0a2c9 +++ ChangeLog d5f15ea69b36d3b49dd6c2e3f3b0c4724bd7a45d @@ -1,5 +1,11 @@ 2006-06-20 Nathaniel Smith + * tester.lua (open_or_err): New function. + (pre_cmd): Use it. It should probably be used much more widely, + but I'm not sure what I'm doing yet... + +2006-06-20 Nathaniel Smith + * INSTALL: Update a little bit, in particular, give a newer boost download link in response to complaint on mailing list, and put 1.9 version number on automake command line. ============================================================ --- tester.lua 5c7149203f3d3735c07ccc7fd348672bd6a50d27 +++ tester.lua 66cae018a22f78d18c2f340e76c2c72b5040f3cd @@ -127,6 +127,14 @@ return n end +function open_or_err(filename, mode, depth) + local file, e = io.open(filename, mode) + if file == nil then + err("Cannot open file " .. filename .. ": " .. e, depth) + end + return file +end + function fsize(filename) local file = io.open(filename, "r") if file == nil then error("Cannot open file " .. filename, 2) end @@ -493,7 +501,7 @@ elseif type(stdin) == "table" then unlogged_copy(stdin[1], ident .. "stdin") else - local infile = io.open(ident .. "stdin", "w") + local infile = open_or_err(ident .. "stdin", "w") if stdin ~= nil and stdin ~= false then infile:write(stdin) end