Skip to content

Conversation

@nofishonfriday
Copy link

As per #5265 (comment)

closes #5265

Copy link
Collaborator

@mgallien mgallien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am really not convinced we need to change it because some closed source software as issues with the behavior of the desktop client
as an user I would be heavily confused (and yes I tested setting a custom icon) if I would see the folder being read-only when I want write access to my Nextcloud files
the big benefit of using the system flag is that we get a less confusing state
I also fail to see why we need to change that now while the current code was doing fine for years

// https://msdn.microsoft.com/en-us/library/windows/desktop/cc144102
DWORD folderAttrs = GetFileAttributesW((wchar_t *)folder.utf16());
SetFileAttributesW((wchar_t *)folder.utf16(), folderAttrs | FILE_ATTRIBUTE_SYSTEM);
SetFileAttributesW((wchar_t *)folder.utf16(), folderAttrs | FILE_ATTRIBUTE_READONLY);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if the folder was already setup to use system flag ?

const auto folderAttrs = GetFileAttributesW(folder.toStdWString().c_str());
if (!SetFileAttributesW(folder.toStdWString().c_str(), folderAttrs & ~FILE_ATTRIBUTE_SYSTEM)) {
qCWarning(lcUtility) << "Remove system file attribute failed for:" << folder;
if (!SetFileAttributesW(folder.toStdWString().c_str(), folderAttrs & ~FILE_ATTRIBUTE_READONLY)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what would happen if this folder was using the system flags ?
we would need to care about existing users

@nofishonfriday
Copy link
Author

nofishonfriday commented Oct 1, 2025

@mgallien

Thanks for the review and thoughts. I'd leave the implementation related issues aside for now until it's decided if this change will be accepted or not.

I am really not convinced we need to change it because some closed source software as issues with the behavior of the desktop client as an user I would be heavily confused (and yes I tested setting a custom icon) if I would see the folder being read-only when I want write access to my Nextcloud files the big benefit of using the system flag is that we get a less confusing state I also fail to see why we need to change that now while the current code was doing fine for years

My motivation for this PR was that I (as Nextcloud user) was confused with the current implementation too.
Wondering why my Nextcloud files don't show up in Total Commander (my go to file explorer), I landed here via Google:
https://www.ghisler.ch/board/viewtopic.php?t=57175
then digging deeper found that thread (even posted there back in 2022):
https://help.nextcloud.com/t/total-commander-does-not-show-nextcloud-main-folder/71602/6
which finally lead me to the GitHub issue here.
Then there are also the issues with file indexing and backup software mentioned by other users

So what I want to say is, imo the current implementation is not unproblematic either.
Question is, which one is less problematic/confusing, I see your argument too, that setting the folder to read only is probably confusing too.

Anyway, as new contributer here, I'm fine with however the regular contributers (you and others) decide, so no problem if this PR gets closed unmerged.

@github-actions
Copy link

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Unnecessary windows system flag (on syned files) causes issues for 3rd party tools

2 participants