Ticket #972 (closed defect: fixed)

Opened 20 months ago

Last modified 19 months ago

lighty.stat() results in error: attempt to call field 'stat' (a nil value)

Reported by: finley@… Owned by: jan
Priority: normal Milestone:
Component: core Version: 1.4.13
Severity: normal Keywords:
Cc: Blocked By:
Need User Feedback: Blocking:

Description

distro: ubuntu edgy i386
lighttpd: 1.4.13~r1370-1ubuntu1
lighttpd-mod-magnet: 1.4.13~r1370-1ubuntu1

The following config chunk:

magnet.attract-physical-path-to = ( "/var/www/magnet/HEADER.html.lua3" )

with this as the contents of the /var/www/magnet/HEADER.html.lua3 file:

print("physical.path: " .. lighty.env["physical.path"] .. "/HEADER.html")
if (nil == lighty.stat(lighty.env["physical.path"] .. "/HEADER.html")) then

    lighty.content = { "<pre>", { filename = "/var/www/HEADER.html" }, "</pre>" }
    lighty.content = ( lighty.env["physical.path"] .. "/HEADER.html" )
    lighty.header["Content-Type"] = "text/html"

    return 200
end

Produces the following in /var/log/lighttpd/error.log:

2007-01-10 15:40:55: (mod_magnet.c.634) lua_pcall(): /var/www/magnet/HEADER.html.lua3:3: attempt to call field 'stat' (a nil value)

Attachments

Change History

Changed 20 months ago by anonymous

use final version

lightty.stat was introduced in r1377

Changed 20 months ago by finley@…

That would do it.

Thanks, -Brian

Changed 19 months ago by jan

  • status changed from new to closed
  • resolution set to fixed

Add/Change #972 (lighty.stat() results in error: attempt to call field 'stat' (a nil value))

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.