History

add hg and python

cinap_lenrek committed 15 years ago

Commit 4bb9e221 parent 987265c3706 files · +1228772 −-233Browse files

Showing the changes to sys/src/cmd/python/Python/getmtime.c (1 of 3706 files). Show all

Unified · Split

sys/src/cmd/python/Python/getmtime.c+26−0
@@ -0,0 +1,26 @@
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
10+extern "C" {
11+#endif
12+
13+time_t
14+PyOS_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+

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t