Re: luafs fileinfo

Thatcher Ulrich <[email protected]> Fri, 5 Mar 2004 09:22:38 -0500
Newsgroups gmane.comp.lang.lua.luacheia
Message-ID <[email protected]>
On Mar 05, 2004 at 12:23 +0200, Serge Semashko wrote:
> Hello All,
> 
> After runing a test script in luacheia (installed from 
> luacheia5-win32-5.0.1a5.exe on Windows XP) I get the following output:
> 
> dummy: No such file or directory
> dummy file not found
> 
> How can I hide this "dummy: No such file or directory" message?
> The source of test script is here:
> 
> cheia.loadmodule("fs")
> if fs.fileinfo("dummy") then
> 	print("dummy file found")
> else
> 	print("dummy file not found")
> end

Hm, that looks like a bug in fs -- it's calling perror() if the file
isn't found, which is bad news.  It should probably return nil and an
error message.  I will change it in CVS.

Thanks for the feedback.

-- 
Thatcher Ulrich
http://tulrich.com


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click