我希望取消函数smbc_opendir(),的默认输出,并仅使用printf进行打印。
gcc文件名.c -lsmbclient
#include <libsmbclient.h>
#include <stdio.h>
void auth_fn()
{
}
int main(int argc,char* argv[])
{
int dirHandle;
if(smbc_init(auth_fn, 10)) /* Initialize things */
{
return 0;
}
dirHandle= smbc_opendir(argv[1]); /* Argument is smb://<ip-address>/ */
/* Just display value of dirHandle in output and nothing else */
printf("%d",dirHandle);
return 0;
}发布于 2012-09-05 14:45:10
尝试调试级别0,它将只记录关键错误:smbc_init(auth_fn, 0)
发布于 2012-09-05 14:40:03
您可以使用以下内容重定向stdout或stderr:
stderr = freopen("/dev/null", "w", stderr );然后你给smbc_opendir打电话。
https://stackoverflow.com/questions/12283752
复制相似问题