delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/06/09/12:57:59

From: "Tim Van Holder" <tim DOT van DOT holder AT pandora DOT be>
To: <djgpp-workers AT delorie DOT com>
Cc: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Subject: Re: .files on servers are perceived as readonly
Date: Sat, 9 Jun 2001 18:58:50 +0200
Message-ID: <CAEGKOHJKAAFPKOCLHDIIEACCEAA.tim.van.holder@pandora.be>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
In-reply-to: <6480-Sat09Jun2001184538+0300-eliz@is.elta.co.il>
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> > > Could you please explain what exactly is wrong with that?  Why did it
> > > annoy you that .cvsignore was shown as not writable?
> > Because it's a writable file.
> 
> Not really:
> 
>     D:\usr\djgpp\data>touch foobarh
> 
>     D:\usr\djgpp\data>attrib +H foobarh
> 
>     D:\usr\djgpp\data>del foobarh
>     File not found

The key point here is that's it ENOFILE, and not EACCESS that is reported.
The programs simply don't SEE the files, but they CAN edit them.

  C:\>attrib -r msdos.sys
  RHS__ -> _HS__  C:\MSDOS.SYS

  C:\>edit msdos.sys
-> edits just fine, doesn't even complain about it being a hidden or
   system file.  Seems to have the side effect of clearing hidden & system
   but that is probably just a MS bug.

  C:\>attrib +r msdos.sys
  ___A_ -> R__A_  C:\MSDOS.SYS

So I'd expect the same behaviour as on DOS: hidden files should not be
seen in directory walks by default (as is the case now), and destructive
commands such as rm should by default pretend not to find them.  The
files should be readonly iff the readonly bit is set.

> > Wouldn't it annoy you if emacs considered
> > .emacs read-only, just because it somehow got its hidden bit set?
> 
> No.  If someone set that bit, I'd surely want to know that there's
> something special about the file.  I certainly would _not_ want to see
> it with only the normal "rw-r--r--" mode bits.

I certainly see your point, but I have a hard time agreeing with it for
hidden files.  Making system files look read-only is fine, but for hidden
files, I'd say it was excessive.
Perhaps for hidden files, you could mask out the group & others bits (i.e.
return 0600 instead of 0666).  That would make them appear different enough
in ls; not sure how it would affect other stat-using programs though.  But
it's certainly no less meaningful that reporting them as read-only when
they're not.
And for system files, you could add the sticky bit (that seems least likely
to cause problems with Unixy apps, but I'm not sure).

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019