summaryrefslogtreecommitdiffstats
path: root/RISCOS/Python/getmtime_riscos.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-03-02 05:58:11 (GMT)
committerGuido van Rossum <guido@python.org>2001-03-02 05:58:11 (GMT)
commit228d80736c39e41a6b46dad211df0ba871b0c8f8 (patch)
treec15c8ecf8664d6c225b6d2f2821068c31e2302d8 /RISCOS/Python/getmtime_riscos.c
parentc92cdf7aa770ee84a2c8e8f219fde4889e5adc92 (diff)
downloadcpython-228d80736c39e41a6b46dad211df0ba871b0c8f8.zip
cpython-228d80736c39e41a6b46dad211df0ba871b0c8f8.tar.gz
cpython-228d80736c39e41a6b46dad211df0ba871b0c8f8.tar.bz2
RISCOS files by dschwertberger
Diffstat (limited to 'RISCOS/Python/getmtime_riscos.c')
-rw-r--r--RISCOS/Python/getmtime_riscos.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/RISCOS/Python/getmtime_riscos.c b/RISCOS/Python/getmtime_riscos.c
new file mode 100644
index 0000000..cbd1669
--- /dev/null
+++ b/RISCOS/Python/getmtime_riscos.c
@@ -0,0 +1,20 @@
+#include <stdio.h>
+
+#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;
+}