The program DATmnt is finished modifing. This day I am going to make unit testing for some import functions in them.
The PopDmdTbl() is so important, and FilterDmdTbl() is too. But I have no way to test them.
//getgrpinfo.c
#include <grp.h>
#include <sys/types.h>
#include <stdio.h>
main()
{
struct group *data;
FILE *stream;
int i;
stream = fopen("/etc/group", "r");
while ((data = fgetgrent(stream)) != 0)
{
i = 0;
printf("%s :%s:%d :", data->gr_name, data->gr_passwd, data->gr_gid);
while (data->gr_mem) printf("%s,", data->gr_mem[i++]);
printf("/n");
}
fclose(stream);
}
May 7th Thursday (五月 七日 木曜日)
最新推荐文章于 2021-12-22 12:48:17 发布