From 228d80736c39e41a6b46dad211df0ba871b0c8f8 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 2 Mar 2001 05:58:11 +0000 Subject: RISCOS files by dschwertberger --- RISCOS/Python/getmtime_riscos.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 RISCOS/Python/getmtime_riscos.c (limited to 'RISCOS/Python/getmtime_riscos.c') diff --git a/RISCOS/Python/getmtime_riscos.c b/RISCOS/Python/getmtime_riscos.c new file mode 100644 index 00000000000..cbd1669275b --- /dev/null +++ b/RISCOS/Python/getmtime_riscos.c @@ -0,0 +1,20 @@ +#include + +#define __swi +#include "osfile.h" + +long PyOS_GetLastModificationTime(char *path, FILE *fp) +{ + int obj; + bits load, exec, ftype; + + if (xosfile_read_stamped_no_path(path, &obj, &load, &exec, 0, 0, &ftype)) return -1; + if (obj != osfile_IS_FILE) return -1; + if (ftype == osfile_TYPE_UNTYPED) return -1; + + load &= 0xFF; + load -= 51; + if (exec < 1855548004U) load--; + exec -= 1855548004U; + return exec/100+42949672*load+(95*load)/100; +} -- cgit v1.2.3