Frank Wunderlich wrote:
i got my path/filename-splitting working
You changed the subject, so I didn't saw you solved your problem...
how can i check in lua for directory-existance and create it if not exist?
i've tried this like this:
function file_exists(name)
local f = openfile(name, "r")
if f then
closefile(f)
return 1
end
return nil
end
but scite doesn't know openfile....
Neither does Lua 5.0...
Now, io.open fails on a directory name, the trick works on Unix but not
on Windows.
That's one of the weaknesses of the stock Lua: it has primitive support
of OS commands, limited to what the standard C offers (for portability
reasons).
I found that running r = os.execute([[dir C:\Windows\]] returns 0 while
it returns 1 if the directory doesn't exist. But a Dos/cmd window
appears briefly.
--
Philippe Lhoste
-- (near) Paris -- France
-- http://Phi.Lho.free.fr
-- -- -- -- -- -- -- -- -- -- -- -- -- --
_______________________________________________
Scite-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scite-interest