42261Re: Force write
- Aug 4, 2003I'm over my depth here. Other than calling chmod from Vim as a ! command
(see :help :!) I can't see anything. Maybe someone else will help?
Y Hu <yh86us@...> wrote:
> Thanks Antoine, my situation is that the file is a
> read-only file, so I have to use chmod 666 filename to
> write. Sometime, the file has been changed, but it
> won't allow me to save it. I use chmod to change the
> read only, but after reloading, all the editing is
> lost. Is there anyway I can force to write a read only
> file or to use chmod inside the the vi whiout lost my
> I used w! to force writing to a read only file without
> using chmod in version 5.7, am I missing something
> Thank you.
> --- "Antoine J. Mechelynck"
> <antoine.mechelynck@...> wrote:
> > Y Hu <yh86us@...> wrote:
> > > Hi,
> > >
> > > In vim version 5.7, I can force writing to a file
> > > using w!. But, now I change to version 6.2, I am
> > not
> > > able to force writing to a read-only file in my
> > local
> > > directory. I really want this function, please how
> > can
> > > I do it in version 6.2?
> > >
> > > Thank you.
> > >
> > > fh
> > >
> > > __________________________________
> > > Do you Yahoo!?
> > > Yahoo! SiteBuilder - Free, easy-to-use web site
> > design software
> > > http://sitebuilder.yahoo.com
> > There are 3 possibilities:
> > (a) You opened the file with :view, or you manually
> > set 'readonly'. Just do
> > > set noro and the write should work (if 'modifiable
> > is set).
> > (b) Another program had the file open with a lock at
> > the time you opened it
> > in vim. First remove the lock (for instance by
> > closing the other program)
> > then go back to (a) above.
> > (c) You don't have write permission in the directory
> > entry for that file.
> > Check it with dir /t (for Dos) or ls -l (for Unix).
> > But maybe you can give
> > yourself permission (if you think you may).
> > Under Unix:
> > chmod a+w filename
> > Under Dos:
> > attrib -r filename.ext
> > If it succeeds, go back to (a). If chmod fails, and
> > you are still sure that
> > you are allowed to modify the file, you must get
> > help from a sysadmin who
> > knows the "root" password. (If it fails for "Invalid
> > parameter a+w" or some
> > such, then try 666 or 777 instead of a+w. -r stands
> > for "minus-readonly",
> > a+w stands for "all-plus-write", 666 stands for
> > rw-rw-rw- and 777 stands for
> > rwxrwxrwx.)
> > HTH,
> > Tony.
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
- << Previous post in topic Next post in topic >>