Mailing List Archive

1 2  View All
RE: Portable and OS-dependent module idea/proposal/brain fart [ In reply to ]
[Fred L. Drake, Jr.]
> I think we can simply declare that isreadonly() checks that the
> file doesn't allow the user to read it,

Had more in mind that the file doesn't allow the user to write it <wink>.

> but setreadonly() sounds to me like it wouldn't be portable to Unix.
> There's more than one (reasonable) way to make a file unreadable to
> a user just by manipulating permission bits, and which is best will
> vary according to both the user and the file's existing permissions.

"Portable" implies least common denominator, and the plain meaning of read-only
is that nobody (whether owner, group or world in Unix) has write permission.
People wanting something beyond that are going beyond what's portable, and
that's fine -- I'm not suggesting getting rid of chmod for Unix dweebs. But by
the same token, Windows dweebs should get some other (as non-portable as chmod)
way to fiddle the bits important on *their* OS (only one of which chmod can
affect).

Billions of newbies will delightedly stick to the portable interface with the
name that makes sense.

the-percentage-of-programmers-doing-systems-programming-shrinks-by-
the-millisecond-ly y'rs - tim
RE: Portable and OS-dependent module idea/proposal/brain fart [ In reply to ]
[Fred L. Drake, Jr.]
> ...
> We left off chmod(), which would make Tim happy, but that was only
> because it wasn't meaningful in context.

I'd be appalled to see chmod go away; for many people it's comfortable and
useful. I want *another* way, to do what little bit is portable in a way that
doesn't require first mastering a badly designed interface from a dying OS
<wink>.

> We'd have to add it (or something equivalent) for a general purpose
> filesystem object. So Tim's only happy if he can come up with a
> general interface that is actually portable (consider my earlier
> comments on setreadonly()).

I don't care about general here; making up a general new way to spell
everything that everyone may want to do under every OS would create an
interface even worse than chmod's. My sister doesn't want to create files that
are read-only to the world but writable to her group -- she just wants to mark
certain precious files as read-only to minimize the chance of accidental
destruction. What she wants is easy to do under Windows or Unix, and I expect
she's the norm rather than the exception.

> On the other hand, you don't need chmod() or anything like it for
> most situations where a filesystem object would be useful. An
> FTPFilesystem class would not be hard to write!

An OO filesystem object with a .makereadonly method suits me fine <wink>.

1 2  View All