]> git.e2factory.org Git - e2factory.git/commitdiff
e2util.stat(): provide nanosecond precision
authorTobias Ulmer <tu@emlix.com>
Wed, 16 Sep 2015 18:50:41 +0000 (20:50 +0200)
committerTobias Ulmer <tu@emlix.com>
Wed, 7 Oct 2015 18:41:56 +0000 (20:41 +0200)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
generic/e2util.c

index 9be5b504075b320356b82e1e4ad73a0c7d18287c..dc38f90e829b5b8e7e5190c75128107b8c5c61ac 100644 (file)
@@ -198,12 +198,21 @@ get_file_statistics(lua_State *lua)
        lua_pushstring(lua, "atime");
        lua_pushnumber(lua, statbuf.st_atime);
        lua_rawset(lua, t);
+       lua_pushstring(lua, "atime_nsec");
+       lua_pushnumber(lua, statbuf.st_atim.tv_nsec);
+       lua_rawset(lua, t);
        lua_pushstring(lua, "mtime");
-       lua_pushnumber(lua, statbuf.st_mtime);
+       lua_pushnumber(lua, statbuf.st_mtim.tv_sec);
+       lua_rawset(lua, t);
+       lua_pushstring(lua, "mtime_nsec");
+       lua_pushnumber(lua, statbuf.st_mtim.tv_nsec);
        lua_rawset(lua, t);
        lua_pushstring(lua, "ctime");
        lua_pushnumber(lua, statbuf.st_ctime);
        lua_rawset(lua, t);
+       lua_pushstring(lua, "ctime_nsec");
+       lua_pushnumber(lua, statbuf.st_ctim.tv_nsec);
+       lua_rawset(lua, t);
        lua_pushstring(lua, "blksize");
        lua_pushnumber(lua, statbuf.st_blksize);
        lua_rawset(lua, t);