From 458120dd40db6b4df55a4e96b650e16798ef06a0 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Tue, 3 May 2011 11:25:13 +0000 Subject: add hg and python --- sys/src/cmd/python/Python/getmtime.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 sys/src/cmd/python/Python/getmtime.c (limited to 'sys/src/cmd/python/Python/getmtime.c') diff --git a/sys/src/cmd/python/Python/getmtime.c b/sys/src/cmd/python/Python/getmtime.c new file mode 100644 index 000000000..54edb531d --- /dev/null +++ b/sys/src/cmd/python/Python/getmtime.c @@ -0,0 +1,26 @@ + +/* Subroutine to get the last modification time of a file */ + +/* (A separate file because this may be OS dependent) */ + +#include "Python.h" +#include "pyconfig.h" + +#ifdef __cplusplus +extern "C" { +#endif + +time_t +PyOS_GetLastModificationTime(char *path, FILE *fp) +{ + struct stat st; + if (fstat(fileno(fp), &st) != 0) + return -1; + else + return st.st_mtime; +} + +#ifdef __cplusplus +} +#endif + -- cgit v1.2.3