[MERGE] Stop treating Permission Denied as lock contention

Alexander Belchenko bialix at ukr.net
Thu Feb 1 09:22:58 GMT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John Arbash Meinel пишет:
> Alexander Belchenko wrote:
> ....
> 
>>>> I know I've definitely had problems for directories. Because there
>>>> doesn't seem to be a separate permission for the directory versus the
>>>> files inside the directory. (I can open up the dialog box and set
>>>> readonly on the dir, and it asks if I want to apply it to all child
>>>> files, but when I open it up again it comes back with the square rather
>>>> than a check, which generally means => some are readonly, some aren't).
>> It's true.
> 
>>>> And after doing so, I was still able to create files inside that
>>>> directory. So obviously it wasn't readonly.
>>>>
>>>> I wish I knew more to tell you.
>>>>
>>>> But as near as I can tell, you can't make a directory readonly on Win32.
>> It's not true.
> 
>> --
>> Alexander
> 
> Can you try this Alexander:
> 
> Open up explorer
> File/New/Folder "test"
> cd test
> File/New/Textfile "test.txt"
> edit test.txt just to put something in it
> cd ..
> File/Properties  Check Readonly
> Apply to This folder and all sub-folders
> cd test
> File/New/Textfile "new.txt"
> edit new.txt
> 
> Now, if the directory was truly readonly, I would expect that you could
> not create a new file there, and that you could not edit that file.
> 
> I just tested this (a couple of times) on my XP Home laptop using NTFS.
> And there was no way I found to prevent me from creating a file in
> "test". After setting the readonly flag it wouldn't let me edit
> 'test.txt', but I could create new files without any problems.
> 
> This may be an issue with XP Home versus XP Professional.

No. This always works the same on any Windows version, and any filesystem.
I check this on Windows 2000 professional. I can check also on win98.
But I'm sure it always do the same. Read-only directories in windows
is not the same as readonly directories in posix means. Readonly for
directory it's only blocks to delete this directory with 'del' command.
Other operations is permitted. And even I could delete this directory
with Explorer, but it show me warning about read-only attribute
and ask me Yes/No.

So if all this behavior is too hobbled to call this truly read-only,
I can agree with you and Aaron that Windows can't make directory
read-only in POSIX terms.

> 
> But I can vouch 100% that on my XPHome laptop, I have found no way to
> actually make a directory that I could not add more content to.
> 
> Which means that there is no way for our test suite to create a
> directory that it will then get "PermissionDenied" from.
> 
> Now, it may be that on XP Pro we will be able to do that. However, I
> have a distinct counter example, which means that regardless of what we
> can do sometimes, the test will *always* fail on my machine.
> 
> Can you confirm your results for your windows machine?
> 
> John
> =:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFwbFyzYr338mxwCURAsupAJ9bTBxSCsQvy4b7lpYpHbF9diLO4wCeL8aD
eZjKkjiDP5zpCX5KBIja1HA=
=kO27
-----END PGP SIGNATURE-----




More information about the bazaar mailing list