|
Luiz Henrique de Figueiredo wrote:
The problem is, the 'app/geresim/prerock/lua' directory contains both a 'corr' directory and a 'corr.lua' file.What is your package.path? something like ?;?.lua;?.lo since 'corr' exists as a directory, the original version of 'readable' is returning 1. yeah.The problem is, apparently fopen succeeds when trying to open a directory but later on, when the file is actually fread from, this error happens. I changed 'readable' so that it will fail if reading from the file fails:That should work in modern Unix systems. luaL_loadfile has similar code. In old Unix systems, directories could be read like ordinary files. (Ah, the good old days...) |