- local file, code, msg = nixio.open(target, "r+")
- if not file and code == nixio.const.ENOENT then
- file, code, msg = nixio.open(target, "w")
- if file then
- file:flush()
- end
- end
+ local oflags = nixio.open_flags("wronly", "creat")
+ local file, code, msg = nixio.open(target, oflags)