This code:

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;
}

Update: same thing happens with non-wide versions.

Generates a number of SMB2 requests with the last character of the path truncated (\buildserver7500\we). I suspect this issue is tied to a large number of issues in our system with network shares. Any clues as to why this is happening?

Wireshark capture of issue

有帮助吗?

解决方案

Stat doesn't work on the share itself. Code using stat to work on arbitrary unc paths needs a special case for \\server\share.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top