Discussion:
Warning: Changing a readonly file - in spite of rwxrwxrwx
(too old to reply)
Thomas Wiedmann
2007-08-29 19:17:51 UTC
Permalink
Hello,

recently, when I intended to edit a text file with vim 6.1, I've got the
message
"W10: Warning: Changing a readonly file".

However the file had the privileges rwxrwxrwx.

1. How or why can a file be readonly - in spite of these priviledges; how
can a file be identified as readonly?
2. How can a readonly file be made writable a) in/with vim (or at least
changes in a readonly file be saved nevertheless) b) without vim, i. e.
by a system command?
3. How can such a warn message be removed again?

Thanks for all good hints.

Thomas Wiedmann
Stan Brown
2007-08-30 14:15:35 UTC
Permalink
Post by Thomas Wiedmann
Hello,
recently, when I intended to edit a text file with vim 6.1, I've got the
message
"W10: Warning: Changing a readonly file".
However the file had the privileges rwxrwxrwx.
1. How or why can a file be readonly - in spite of these priviledges; how
can a file be identified as readonly?
:set ro
would do it. Is there such a mode line in the file itself?
Post by Thomas Wiedmann
2. How can a readonly file be made writable a) in/with vim
:set noro
--
"First prove what you're saying, then whine about it."
-- /The People's Court/
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
notPythias
2007-09-03 22:52:56 UTC
Permalink
Post by Thomas Wiedmann
1. How or why can a file be readonly - in spite of these priviledges; how
can a file be identified as readonly?
Is it possible that another program has locked the file? I don't know
much about Linux file locking, but I do believe it allows write locks.
Would vim interpret that as cause to show you a readonly warning?

-nP
paf the dog
2007-09-04 00:20:36 UTC
Permalink
Post by notPythias
Post by Thomas Wiedmann
1. How or why can a file be readonly - in spite of these priviledges; how
can a file be identified as readonly?
Is it possible that another program has locked the file? I don't know
much about Linux file locking, but I do believe it allows write locks.
Would vim interpret that as cause to show you a readonly warning?
what else is possible is a i attribute or a ro mounted partition

lsattr

in case i, su -c 'chattr -i the_file'
--
paf the dog
remove primate to reply
Loading...