From 7f83cabdad47cf5dd2dace5b71a7de37e87a8ab4 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Tue, 22 May 2012 12:54:51 -0600 Subject: [PATCH] make wopr work again --- packages/wopr/www/wopr/wopr.cgi | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/packages/wopr/www/wopr/wopr.cgi b/packages/wopr/www/wopr/wopr.cgi index 1a9e382..2e40cb1 100755 --- a/packages/wopr/www/wopr/wopr.cgi +++ b/packages/wopr/www/wopr/wopr.cgi @@ -1,6 +1,4 @@ -#! /usr/bin/lua - -require("lfs") +#! /bin/env lua BASEDIR = "/var/tmp/wopr" POST_MAX = 512 @@ -128,7 +126,7 @@ end -- function get(key, ...) - local fn = string.format("%s/%s", dirname, key) + local fn = string.format("%s.%s", dirname, key) local f = io.open(fn) if (not f) then return arg[1] @@ -140,12 +138,9 @@ function get(key, ...) end function set(key, ...) - local fn = string.format("%s/%s", dirname, key) + local fn = string.format("%s.%s", dirname, key) local f - -- Lazy mkdir to save a few inodes - lfs.mkdir(dirname) - f = io.open(fn, "w") if not f then error("Unable to write " .. fn) @@ -155,7 +150,7 @@ function set(key, ...) end function del(key) - local fn = string.format("%s/%s", dirname, key) + local fn = string.format("%s.%s", dirname, key) os.remove(fn) end