windows 10 does not allow me to remove the read only checkbox in the properties of a directory

windows 10 does not allow me to remove the read only checkbox in the properties of a directory.

Hi guys; I am learning programming, and I have encountered a problem that is related to the operating system and not to the programming, just to put them in context:

to program in php using symfony v5.3; requires being able to put write permissions to a specific folder ...

the related directory is: C:\xampp\htdocs\dev\p1\paguelofacil/var/cache/dev

this directory exists; you have the necessary users and the users have the read and write permissions; the problem is that no matter how much I try to change the read-only check-box it persists ...

I have tried everything that this other post says and I have not found a solution; even I do not receive any errors ... and in the post I do mention if there is an error ...

Windows 10 not able to remove read only atttribute of the folders

even run the following command if no result ...

attrib -r C:\xampp\htdocs\dev\p1\paguelofacil\var\*.* /s

If more information is needed, do not hesitate to request it.

enter image description here

enter image description here

enter image description here

Update:

To rule out that it is a user permissions problem or that it is a problem with the php script I have done the following:

  1. I have placed a patch (PHP) where I correct the write permission in the directory:
    echo 'Directory Exist '. $dir .'<br>';
    echo get_current_user().'<br>';
    echo substr(sprintf('%o', fileperms($dir)), -4).'<br>';
    chmod ($dir, 755);

Output:

enter image description here

result of this: solve the problem in a bad way ...

if the user does not have the necessary permissions; PHP would have thrown a fatal error! with this patch the error is removed but it is not the correct thing.

This is not correct because I should not change permissions from my code ... it is assumed that the permissions must be on the properties and attributes of the directory.

if I remove the patch then the error will come up again; this tells me that it does not matter if I put the attribute or permission; this is lost ...


Let's clarify the following: in order to create files (any format) within a directory, we programmers must validate that within that directory we can write ... in Linux the directory must have at least 755 permissions; so I ask you where I can do something similar with Windows?

when we validate a directory, with is_writable if the directory has permissions 0555 it will spit out a false (you cannot write to this directory); this permission is general; It is not associated with any user; In linux it is validated that the user / group is the owner of the directory too ... but I have already established this in windows it is assumed that by giving permissions to everyone, I am giving access to all users ...

enter image description here

enter image description here

enter image description here


Solution 1:

That checkbox is not a status indicator, it's a tri-state switch. The select state is applied when the OK or Apply button is clicked

The three states are:

  • Checked: Set ReadOnly attribute for all files within the folder
  • Cleared: Clear ReadOnly attribute for all files within folder
  • Gray Square: Take no action (Default on dialog display)

It's just extremely poor UI design, as the Hidden checkbox is both switch and status indicator.

The only accurate way to determine the status of the ReadOnly attribute for folders is to add the Attributes column to a Details view in File Explorer.

enter image description here

Be aware the attribute does not affect read/write permissions for the folder or its contents. For directories, it functions as a flag that tells Windows to process the folder's desktop.ini file (Custom folder icons, localizeed display names, and other custom behavior).



Check effective permissions on the folder via the Advanced dialog accessed from the Security tab of the Properties dialog:

enter image description here

Select the Effective Access tab and then a user:

enter image description here

Then select View effective access:

enter image description here