It still might be a disk space issue. Some OSes reserve the last bit of
space for the system/root only. I wouldn't have thought it was a whole
5% though.
I presume you've tried saving the file with a different name (using an
argument to :w or the :saveas command)?
Vim does have 'swapsync' and 'fsync' options you can investigate (:help
'swapsync' and :help 'fsync') but if it hasn't always happened, I expect
something is truly wrong, and fiddling those options may just give you a
false sense of security by avoiding the issue rather than actually
letting you secure your data.
Ben.
Also fiddling with the 'writebackup' and 'backup' options can help save
a file if the disk is almost full, but of course it's more dangerous if
you don't use/keep backups.
:help 'backup'
:help 'writebackup'
:help :w_f
:help :saveas
Ben.
How about adding the value of errno or strerror(errno) in the
error message? It would help diagnose such errors. There
could be several reasons such as file system full, quota exceeded,
invalid file descriptor, etc.
-- Dominique
Yes, the patch is a patch to the Vim source code that would add the
errno to the error message you are seeing if Vim were recompiled. I
didn't expect it to help in your situation, but it may help if/when this
kind of problem occurs again.
> Also, I deleted several directories in order to free up space, but
> keep seeing this problem. Had never seen this problem before. I am
> trying to save the original file using ":w<enter>" (that is, not with
> a different name).
Is this just happening for one file you have open, or for multiple
files? Can you try saving the file with a different name and if that
doesn't work, try a completely different directory as well? Maybe the
directory the file was originally in has moved or become corrupted or
something. It seems unlikely, as fsync is failing, not open, but
still... Or perhaps you can just get your data onto disk with something
like
:w !cat > somefile
then verify with some other tool that somefile does contain your data
before abandoning it in Vim.
Is this happening for just one file, or every file you edit, or what?
Could you send us the output of Vim's :version command? You can
hopefully capture it with
:redir > someotherfile
:version
:redir END
and then send us the contents of someotherfile.
Cheers,
Ben.
Mmm. Sounds like something funny has been going on with your OS or disk.
I can think of a couple of reasons you could see symptoms like you
describe, but they're a bit too technical and vague to bother
explaining, particularly as they would only be explanations, not
solutions.
I'd recommend a full fsck (i.e. not just the standard journal check)
though. That might just iron things out.
Ben.
Even if it's not Vim which does it, sooner or later _every_ HD will
prove too small, and it sounds like you (googler) are dangerously
skirting that wall now.
I guess the only medium-range solution is to rack your pocket bottoms
and/or break your piggy bank for the price of a new and bigger disk ;-).
A short-term workaround (but not a solution) might be to search your
drive for large files which you don't need and can safely delete --
delete forever, not just move to trash. Or maybe just emptying the trash
might already give you some "breathing room", so to speak. Try to delete
only files which you know about, so you won't haplessly delete something
which is badly needed by the OS but whose name means nothing to you.
There is no really permanent solution for the long term -- other than
starting a new piggy bank for the next drive as soon as you've bought
this one: this is (loosely speaking) what company accountants mean by
"amortization".
Best regards,
Tony.
--
Paul Revere was a tattle-tale