Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] vim 6.1 on RH 8.0 behaviour for readonly files

Chris Velevitch wrote:
> When using vim 6.1 on RH 8.0 to edit a read only file, if you modify
> the file and save the changes with :w! and continue editing, the file
> permissions are still read only and all subsequent save of changes,
> each time, require the use of :w! .
> I would have expected the file permissions to be permanently changed
> to read/write after the first save. Is this a reasonable behaviour? Is
> there an option to make vim behave this way?

Is this reasonable? Well look at it from vim's viewpoint. 
You have told vim to open the file read only and now the user persists
in using :w! :-)

>From within vim you can run shell programs like ls by putting an ! in
front of the command i.e.

so to change the permissions to writable....
:!chmod u+w file

may work.

Mike Lake
Uni of Technol., Sydney

UTS CRICOS Provider Code:  00099F

This email message and any accompanying attachments may contain
confidential information.  If you are not the intended recipient, do not
read, use, disseminate, distribute or copy this message or attachments.
If you have received this message in error, please notify the sender
immediately and delete this message. Any views expressed in this message
are those of the individual sender, except where the sender expressly,
and with authority, states them to be the views the University of
Technology Sydney. Before opening any attachments, please check them for
viruses and defects.