PageRenderTime 303ms CodeModel.GetById 135ms app.highlight 1ms RepoModel.GetById 166ms app.codeStats 0ms

/Python/getmtime.c

http://unladen-swallow.googlecode.com/
C | 26 lines | 17 code | 7 blank | 2 comment | 2 complexity | 68c44e0b9221873d390da604b12883c8 MD5 | raw file
 1
 2/* Subroutine to get the last modification time of a file */
 3
 4/* (A separate file because this may be OS dependent) */
 5
 6#include "Python.h"
 7#include "pyconfig.h"
 8
 9#ifdef __cplusplus
10extern "C" {
11#endif
12
13time_t
14PyOS_GetLastModificationTime(char *path, FILE *fp)
15{
16	struct stat st;
17	if (fstat(fileno(fp), &st) != 0)
18		return -1;
19	else
20		return st.st_mtime;
21}
22
23#ifdef __cplusplus
24}
25#endif
26