_wstat和Windows 7共享的路径截断问题

时间:2012-12-06 20:02:52

标签: windows windows-7 smb stat

此代码:

int main()
{
   wchar_t fnucs2[260];
   wcscpy(fnucs2, L"//buildserver7500/wec");
   std::wcout << L" | wstat: " << fnucs2 << std::endl;
   struct _stat32i64 b;
   int r;
   r = _wstat32i64(fnucs2, &b);            

   return 0;
}

更新:非宽版本也会发生同样的事情。

生成许多SMB2请求,并截断路径的最后一个字符(\ buildserver7500 \ we)。我怀疑这个问题与我们的网络共享系统中的大量问题有关。关于为什么会发生这种情况的任何线索?

Wireshark capture of issue

1 个答案:

答案 0 :(得分:0)

Stat不适用于共享本身。使用stat处理任意unc路径的代码需要\\ server \ share的特殊情况。

相关问题