Show More
@@ -1079,6 +1079,20 b' const char *getfstype(const char *path) ' | |||
|
1079 | 1079 | /* End of Linux filesystems */ |
|
1080 | 1080 | return NULL; |
|
1081 | 1081 | } |
|
1082 | ||
|
1083 | static PyObject *pygetfstype(PyObject *self, PyObject *args) | |
|
1084 | { | |
|
1085 | const char *path = NULL; | |
|
1086 | if (!PyArg_ParseTuple(args, "s", &path)) | |
|
1087 | return NULL; | |
|
1088 | ||
|
1089 | const char *type = getfstype(path); | |
|
1090 | if (type == NULL) | |
|
1091 | Py_RETURN_NONE; | |
|
1092 | ||
|
1093 | PyObject *result = Py_BuildValue("s", type); | |
|
1094 | return result; | |
|
1095 | } | |
|
1082 | 1096 | #endif /* def HAVE_STATFS */ |
|
1083 | 1097 | |
|
1084 | 1098 | #endif /* ndef _WIN32 */ |
@@ -1257,6 +1271,10 b' static PyMethodDef methods[] = {' | |||
|
1257 | 1271 | {"setprocname", (PyCFunction)setprocname, METH_VARARGS, |
|
1258 | 1272 | "set process title (best-effort)\n"}, |
|
1259 | 1273 | #endif |
|
1274 | #ifdef HAVE_STATFS | |
|
1275 | {"getfstype", (PyCFunction)pygetfstype, METH_VARARGS, | |
|
1276 | "get filesystem type (best-effort)\n"}, | |
|
1277 | #endif | |
|
1260 | 1278 | #endif /* ndef _WIN32 */ |
|
1261 | 1279 | #ifdef __APPLE__ |
|
1262 | 1280 | { |
General Comments 0
You need to be logged in to leave comments.
Login now