Предупреждение с nftw

In [1]: d = {
   ...:     "258771223473815553": {"total": 32923, "points": 13},...
...
In [2]: max(d.items(), key = lambda tup: tup[1]['points'])[0]
Out[2]: '550047284008583168'
9
задан Brian Campbell 23 April 2009 в 16:19
поделиться

2 ответа

Linux, по какой-то причине, все еще использует SUSv1 для этого API, где nftw () все еще считается расширением.

На странице руководства Linux , include должно быть:

#define _XOPEN_SOURCE 500
#include <ftw.h>
9
ответ дан 4 December 2019 в 21:51
поделиться

Hmm. Your code works for me. Check your include paths, maybe? Though this is a system header, so it should be pretty hard to miss this. Or were you accidentally compiling a version that didn't have the #include line?

$ gcc -o ftw ftw.c
$ ./ftw my-directory
File 10
File 11
File 16
File 16
File 16
File 16
File 16
... etc ...

edit: The test above was done on Mac OS X. In a (now deleted) comment the OP mentioned he was on Debian, for which the man page mentions that #define _XOPEN_SOURCE 500 is necessary, as Juliano points out.

0
ответ дан 4 December 2019 в 21:51
поделиться
Другие вопросы по тегам:

Похожие вопросы: