the light at the end of the tunnel …
is probably not an oncoming train after all.
Mind you, there is no way to be really sure - one more week of hectic, panic stricken pandering to deadlines before I can go into hibernation for the winter and anything could happen in the next 3 days.
I consider myself to be reasonably competent with managing mundane adminstrative activities on most machines… be they Windows, Linux or Solaris. I can probably figure my way around BSD too. So why am I stumped by a pathetic permissions problem on Windows ?
It all started one fine morning a few months ago (starts the story) when writes to a particular directory started failing. Plenty of disk space available, permissions seemed ok, so there was no real reason for the writes to fail. You’d think. But they did. So, I inspect the permissions of the files that I was trying to overwrite (they weren’t in use at the time) and I find no clues. I inspect the directory and see that the read-only box is greyed out. Basically, in Windows-UI convention, this is a visual cue that some of the files in that directory are indeed, read-only. Forgot about it, only to have the problem reappear today.
No big deal, I login as administrator (what, you think I run on a Windows machine as admin ? I just look crazy, I’m not suicidal.) and try to change the permissions. There is a prompt (do I want this to the current folder or to all the subfolders). I make my choice - there is a bit of hard disk churning after the read-only box is unchecked. Things are back to normal. Only, when I reopen the Properties sheet, the read-only tick is back again. Do this several times and nothing changes. Change from current folder only to subfolders and files. Nothing. The greyed-out read-only tick silently mocks my inability to banish it from my presence.
Daunted ? Not I. I read the Microsoft knowledgebase, the oracle of all things Microsoft, and find this article. This greyed-out read-only tick means nothing, they reassure me. See, Windows components ignore the read-only flag in folders. In a completely unexpected turn of events (at MS HQ, maybe) I use software beyond mere Windows components. Other software manufacturers, it seems, haven’t gotten this particular memo about read-only folders being an anachronism.
So I faithfully follow advice and open up a command prompt (in Windows ? Oh, bring on the smelling salts, I feel faint *snigger*). Type in the old skool attrib command. To no avail.
It’s ignominious when a mere chunk of plastic and metal components manages to frustrate me this much. Still, I have other things to be doing, and I really do need those files overwritten. The files happen to be the MySQL data files for my test blog, installed on my local machine and happily running a bleeding edge beta 2.0 version of Wordpress. A recent change made was a version number for the database schema… and if Wordpress detects that the database schema is out of date, it automatically prompts an upgrade. Only, the upgrade requires writing (updating) the MySQL database files and if the files are shown as read-only, all the updates fail… See ? The MySQL daemon is slow on the uptake and hadn’t really been listening to Microsoft’s frantic appeals that no, no, no.. that read-only flag on the folder doesn’t mean anything, honest. And since I’m ranting about it, here’s the semi-official line about why setting the +r and +s attributes are so important - Raymond Chen explains. I’m sure if I had installed SQL Server instead of that godawful MySQL, this wouldn’t have happened. Silly me.
So, I actually create a new directory (with the command prompt, thank you very much), copy all the MySQL files over and check the attributes. Blowing away the offending directory and renaming the new guy to the old name are the next steps … and this, for some reason, works as expected. I’m still not sure how, but an hour and a half is probably enough time to be futzing around with file permissions.
On 23-Nov-05 at 9:35 pm,
Splee wrote:
I *hate* that little known fact about the read-only attribute for folders in windows. It’s actually used to tell explorer to check the folder’s Desktop.ini file for any special attributes. How pointless is that?! I defy anyone to find any useful “special attributes” that actually make any difference.
Basically, microsoft have more dirty, evil, horribly implimented workarounds than… well, there is no comparison. They’re in a league of their own.
On 28-Nov-05 at 4:20 pm,
drac wrote:
Yeah, I know… the problem is documentation, I suppose. They shoehorn something into a place where it obviously doesn’t fit and everyone else who follows the spec faithfully will do something different.
Hidden behaviour which does something unexpected = bad