linux fixes

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-08-03 17:59:35 -07:00
parent cbfdf99a9e
commit e28602dbbb
42 changed files with 186 additions and 225 deletions
+4 -5
View File
@@ -2217,15 +2217,14 @@ uint32 CFileUtil::GetAttributes(const char* filename, bool bUseSourceControl /*=
return SCC_FILE_ATTRIBUTE_READONLY | SCC_FILE_ATTRIBUTE_INPAK;
}
AZStd::wstring fileW;
AZStd::to_wstring(fileW, file.GetAdjustedFilename());
DWORD dwAttrib = ::GetFileAttributesW(fileW.c_str());
if (dwAttrib == INVALID_FILE_ATTRIBUTES)
const char* adjustedFile = file.GetAdjustedFilename();
if (!AZ::IO::SystemFile::Exists(adjustedFile))
{
return SCC_FILE_ATTRIBUTE_INVALID;
}
if (dwAttrib & FILE_ATTRIBUTE_READONLY)
if (!AZ::IO::SystemFile::IsWritable(adjustedFile))
{
return SCC_FILE_ATTRIBUTE_NORMAL | SCC_FILE_ATTRIBUTE_READONLY;
}