Results 1 to 6 of 6

Thread: Webserver Lua Code Problem

  1. #1
    Join Date
    May 2004
    Location
    Dallas, TX
    Posts
    1,032

    Default Webserver Lua Code Problem

    I have the following code in a .lhtml file. The LogFile variable is actually assigned a file name passed in thru webserver:GetCGI(). I have it hard coded for testing this issue.

    Code:
    <table width="70%" align="center" cellspacing="0" cellpadding="0">
        <tr>
            <td class="securitylog">
                <%
                local LogFile = "WebAccess "..os.date("%Y-%m-%d")..".Log"
                local ConfigFile = win.GetDirectory('GIRDERDIR').."\\UserData\\WebAccess\\"
                webserver:print (ConfigFile..LogFile)
                %>
            </td>
        </tr>
    </table>
    When I access the page the actual lua code is displayed on the screen instead of just printing the ConfigFile..LogFile. I believe the problem is the last \\ on the win.GetDirectory line. If I remove the \\ then the page displays however the file path/name is not usable for retreiving the contents of the file. Bug or am I doing something wrong? Same problem on versions 4.0.5.1 & 4.0.5.2.

  2. #2
    Join Date
    Jan 2000
    Location
    Jupiter, FL
    Posts
    11,400

    Default

    I think I know what that is. The parser gets confused by the \\" .

    Code:
                <%
                local LogFile = "WebAccess "..os.date("%Y-%m-%d")..".Log"
                local ConfigFile = win.GetDirectory('GIRDERDIR').."/UserData/WebAccess/"
                webserver:print (ConfigFile..LogFile)
                %>
    Ron
    No support through PM

  3. #3
    Join Date
    May 2004
    Location
    Dallas, TX
    Posts
    1,032

    Default

    NOt in front of my development machine at the moment. How will that affect the file io routines? Will C:\Program Files\Promixis\Girder/UserData/WebAccess/WebAccess 2006-09-20.Log be a valid path?

  4. #4
    Join Date
    Jan 2000
    Location
    Jupiter, FL
    Posts
    11,400

    Default

    should work just fine.
    Ron
    No support through PM

  5. #5
    Join Date
    May 2004
    Location
    Dallas, TX
    Posts
    1,032

    Default

    Ok, I will give it a try tonight.

    Thanks

  6. #6
    Join Date
    May 2004
    Location
    Dallas, TX
    Posts
    1,032

    Default

    All is good.

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •