#!/bin/lua

local libcore = require("libcore")

if #arg > 1 then
    for i = 1, #arg - 1 do
        local status = io.write("", os.join(arg[i]))

        if status > 0 then
            local message = libcore.errormsg(status)

            print("touch: " .. arg[i] .. ": " .. message)
            os.exit(status)
        end
    end
else
    print("touch: usage: touch [file]")
    os.exit(2)
end