Pergunta

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

Foi útil?

Solução

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top