Mercurial > cpython-lru_cache-weakref
diff RISCOS/Python/getmtime_riscos.c @ 16941:a015aed3a1ac legacy-trunk
RISCOS files by dschwertberger
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Fri, 02 Mar 2001 05:58:11 +0000 |
| parents | |
| children | 2d3cee9f1633 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/RISCOS/Python/getmtime_riscos.c Fri Mar 02 05:58:11 2001 +0000 @@ -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; +}
