Return-Path: X-Original-To: apmail-httpd-dev-archive@www.apache.org Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 104BAF66E for ; Fri, 12 Apr 2013 19:02:13 +0000 (UTC) Received: (qmail 98750 invoked by uid 500); 12 Apr 2013 19:02:12 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 98700 invoked by uid 500); 12 Apr 2013 19:02:12 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 98692 invoked by uid 99); 12 Apr 2013 19:02:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Apr 2013 19:02:12 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [194.242.35.75] (HELO dns-factory.at) (194.242.35.75) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Apr 2013 19:02:07 +0000 Received: from [172.17.100.8] apache@gknw.net [62.143.120.100] by dns-factory.at with NetMail SMTP Agent $Revision: 8582 $ on Novell NetWare via secured & encrypted transport (TLS); Fri, 12 Apr 2013 21:01:33 +0200 Message-ID: <51685A02.1030804@apache.org> Date: Fri, 12 Apr 2013 21:01:22 +0200 From: Guenter Knauf User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: dev@httpd.apache.org Subject: Re: svn commit: r1466669 - /httpd/httpd/branches/2.4.x/STATUS References: <20130410210152.1EFA423888FE@eris.apache.org> <5165D7D5.8010200@apache.org> <51668AD0.2050502@cord.dk> <51668FB2.1090208@apache.org> In-Reply-To: <51668FB2.1090208@apache.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On 11.04.2013 12:25, Guenter Knauf wrote: > well, another possible fix would be this one: > > Index: modules/lua/lua_request.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- modules/lua/lua_request.c (revision 1466743) > +++ modules/lua/lua_request.c (working copy) > @@ -1204,19 +1204,19 @@ > luaL_checktype(L, 2, LUA_TSTRING); > r =3D ap_lua_check_request_rec(L, 1); > filename =3D lua_tostring(L, 2); > - if (apr_stat(&file_info, filename, APR_FINFO_NORM, r->pool) =3D=3D= OK) { > + if (apr_stat(&file_info, filename, APR_FINFO_MIN, r->pool) =3D=3D = OK) { > lua_newtable(L); > > lua_pushstring(L, "mtime"); > - lua_pushinteger(L, (ptrdiff_t)(file_info.mtime / 1000000)); > + lua_pushnumber(L, file_info.mtime); > lua_settable(L, -3); > > lua_pushstring(L, "atime"); > - lua_pushinteger(L, (ptrdiff_t)(file_info.atime / 1000000)); > + lua_pushnumber(L, file_info.atime); > lua_settable(L, -3); > > lua_pushstring(L, "ctime"); > - lua_pushinteger(L, (ptrdiff_t)(file_info.ctime / 1000000)); > + lua_pushnumber(L, file_info.ctime); > lua_settable(L, -3); > > lua_pushstring(L, "size"); > > this way we bring the higher resolution of the time values into Lua; > however I've not yet checked if there are platforms which really provid= e > mtime/atime/ctime with a better resolution than 1 second; > if there are then it makes probably sense for the above patch, and then= > do the divide if needed within the Lua scripts like: > > local mtime =3D os.date(fmt, math.floor(info.mtime / 1000000)) > r:puts( ("%s was last modified at: %s\n"):format(r.filename, mtime) ) > > since there might be usage cases for the time values other than feeding= > os.date() for displaying, f.e. a simple compare; and one second is long= ;-) > > comments welcome! no comment so far; I searched a bit more about this, and found: http://en.wikipedia.org/wiki/Stat_%28system_call%29#Granularity_of_mtime.= 2C_etc. therefore I will apply above patch to get the finer granularity into=20 mod_lua. G=C3=BCn.