From 4e1daf28000a31a4c5a0a9d053f88961a2c7f44a Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Wed, 8 Jul 2009 16:39:32 -0400 Subject: Use lfs.attributes for existance test instead of fopen; init.lua --- init.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index 5657efe5..a86c65b7 100644 --- a/init.lua +++ b/init.lua @@ -7,9 +7,8 @@ package.path = mpath..';'..package.path local loaded_user_modules = false local user_init = _USERHOME..'/init.lua' -local f = io.open(user_init) -if f then - f:close() +local lfs = require 'lfs' +if lfs.attributes(user_init) then local ret, errmsg = pcall(dofile, user_init) if not ret then error(errmsg) end loaded_user_modules = ret -- cgit v1.2.3