6. Problems Saving Files under vi


	Problem		How come?		What to do
	-------		---------               ----------
1) You try to save your	File already exists	Use w! file  to
file and get:		(perhaps you saved	overwrite the
(a) File exists		it previously)		existing file or
(b) File 'file' exists				use :w!. newfile
       - use :w!				to save a new
(c) [existing file]				version

2) You try to write     There is no room	Type :!df to see
file and get a message:	in the file system	if there is any 
file system is full	on the hard disk	space on 
			to put your saved 	another file
			file at the moment	system. If so,
						choose a 
						directory on that 
						file system and 
						write your file to 
						it with
						:w! fullpathfile 

3) The system puts you 	The file system on	Use :ls -la /tmp
into open mode and says	the hard disk where	to see if there 
that the file system is	vi's temporary files	are any files you
full			are, is filled up.	can remove to
						gain some space. 
						Use :sh to start 
						a shell to do the 
						file removal (rm 
						/tmp/file(s). 
						Then ^D to 
						return to vi 
						when done. 
						Finally write 
						your file with :w!

4) You want to write 	You do not have		Use :w! newfile
your file, but you  	write permission for 	You can use rm
haven't permission to 	this file		and mv to
do it.						replace the
						original with 
						your copy of it

Questions? Robert Katz: arkay@arkaye.org
Last Update July 6, 2015