Changes to work for windows + linux

This commit is contained in:
Matthew 2024-09-19 03:24:35 +02:00
parent 06513d81f8
commit 6e3e2400fb
1 changed files with 2 additions and 2 deletions

View File

@ -277,7 +277,7 @@ void MemoryCardConvertDialog::ConvertCard()
// Windows has no direct R/W/X permission model like Linux. We check for basic file existence. // Windows has no direct R/W/X permission model like Linux. We check for basic file existence.
bool canRead = !(fileAttributes & FILE_ATTRIBUTE_READONLY); bool canRead = !(fileAttributes & FILE_ATTRIBUTE_READONLY);
bool canWrite = true; // If not read-only, assume write is possible (for this basic example) bool canWrite = true; // If not read-only, assume write is possible.
if !(canRead && canWrite) if !(canRead && canWrite)
{ {
@ -286,7 +286,7 @@ void MemoryCardConvertDialog::ConvertCard()
} }
#else #else
// Linux/Unix code using access() for checking R/W/X permissions // Linux/Unix systems
if (access(dirPath.toStdString().c_str(), R_OK | W_OK | X_OK) != 0) if (access(dirPath.toStdString().c_str(), R_OK | W_OK | X_OK) != 0)
{ {
PermissionError(absolutePath); PermissionError(absolutePath);