About Archive Tags RSS Feed

 

Lua annoyance

31 October 2005 21:50

Lua Directory Handling

Arrrgggghhhhh!!!! OK maybe lua is not love.

I just realised that Lua has no concept of directory handling (opendir, readdir, etc). Indeed it isn't possible to tell whether something is a directory or a file.

So I added some more primitives to the Lua socket extension library. Most usefully a readdir call.

This means the sample webserver can now serve directory contents if index.html isn't found. It can also now fall back to serving a "default virtual host" if the requested one doesn't exist.

The webserver code is now very stable and complete. The only omission is CGI handling, but I'm not going to bother unless prompted strongly.

I've added some simple examples to the documentation and I think things are looking good. The Debian package has been downloaded a few times, but no real feedback - feel free to share, don't be shy!

| No comments