[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 3 questions...

From: Noel L Yap
Subject: Re: 3 questions...
Date: Tue, 23 Jan 2001 14:22:29 -0500

>> I don't think so. You have to be owner (or root) to change the permissions.
>Well, that seems a little silly as the following makes you the owner if you
>write permissions to the directory:
>    #! /bin/sh
>    cat afile,v >afile,
>    mv afile, afile,v

If you peek under the hood, the new afile,v isn't the same file as the old
afile,v (ie they have different inodes).

Looking at it a different way, it makes sense 'cos when you're copying and
moving files, you're really changing (ie writing) the directory.

We actually take advantage of this feature to coordinate our work.  We set our
umasks to 027 making files group read-only.  It is now impossible to write over
accidentally someone else's file (eg, an installed jar file).  Ideally we would
contact the owner of the file to see if they're still working on it.  If they're
not working on it, or if they can't be contacted, we move the file out of the
way, and create our own.


This communication is for informational purposes only.  It is not intended as
an offer or solicitation for the purchase or sale of any financial instrument
or as an official confirmation of any transaction. All market prices, data
and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein
do not necessarily reflect those of J.P. Morgan Chase & Co. Incorporated, its
subsidiaries and affiliates.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]