PDA

View Full Version : [ubuntu] vi: can't open file for writing



yawnmoth
March 15th, 2010, 09:03 PM
I'm trying to edit a file in vi and when I hit Esc and type in :w I get the following error:


"test.sh" E212: Can't open file for writing

Here are the permissions of the directory I'm trying to save the file to: drwxr-xr-x

Any ideas?

blur xc
March 15th, 2010, 09:04 PM
I'm trying to edit a file in vi and when I hit Esc and type in :w I get the following error:



Here are the permissions of the directory I'm trying to save the file to: drwxr-xr-x

Any ideas?

Are you the owner of the directory?

BM

yawnmoth
March 16th, 2010, 04:32 AM
Are you the owner of the directory?

BM

I thought I was but apparently I wasn't logged in as the user I thought I was. Doing "su - correctuser" fixed the problem.