vim (windows only) readonly problem (on folders?)

217 views
Skip to first unread message

dza

unread,
Nov 11, 2013, 5:50:49 AM11/11/13
to vim...@googlegroups.com
Hello guys.

Starting last week or the week before - several files I was editing without problems started becoming readonly. It can happen on the first or the second write- it is indeed quite random.

However, I tried with a clean vimrc and empty bundle of scripts and it still persists.

I did check every folder (and all files) where I was editing.

Indeed every folder on my entire Windows 7 system is marked "Read-Only" this problem seems to spook Windows users (http://itexpertvoice.com/home/fixing-the-windows-7-read-only-folder-blues/).

I'm unsure whether this is Vim or Windows' fault ?

I tried alot of the suggestions on the Windows side of things (couldn't find much help in Vim threads) - none of it worked.

I closed all applications that could lock the filesystem (Kaspersky, SpiderOak for backups).

Using "set noreadonly" doesn't work either. It reappears as "readonly"

error E505 or E45 "readonly".

Regards,
Christoffer.

Ben Fritz

unread,
Nov 11, 2013, 12:05:04 PM11/11/13
to vim...@googlegroups.com

You link to an article and describe your issue in a way that I'm pretty sure the root cause is Windows' fault. Vim certainly isn't setting directory permissions to read-only across your filesystem! But Vim settings might combine with this to lead to your problem writing files.

I think it's possible that if Vim creates a file in a directory, and the directory is read-only, that Vim will also create the file as read-only.

But depending on your settings, Vim might edit EXISTING files by first renaming the old version of the file, then writing a NEW file with the old name. If I'm right about how Vim creates new files in a read-only directory, then this would cause the file to be readonly.

So read the following help topics and check the value of the associated options, maybe you can find a fix here:

:help 'backupcopy'
:help 'backupskip'
:help 'writebackup'

Christoffer Aasted

unread,
Nov 13, 2013, 8:51:12 AM11/13/13
to vim...@googlegroups.com
I actually did disable writebackup and other temporary files with:

set nobackup
set nowb
set noswapfile

and

set dir-=.
set backupdir-=.
set undodir-=.

backupcopy is default = auto.

Because of other problems I had with slow network shares and what not.

I have the exact same thought as you about Windows 7 and the folders defaulting to "read only" ... It's really true - try to create a new folder and check it - it will always remain readonly (By design, if you ask Microsoft).

The weird thing about this, is that it doesn't happen in all folders at all - and it really is somehow random. If I force a write with :w! I can possibly write once or twice more - but then it becomes [RO] read only again.

Thanks for your answer :)



--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to a topic in the Google Groups "vim_use" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/IYTCd1eIba0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vim_use+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Reply all
Reply to author
Forward
0 new messages