This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Can't write any.files from vi


On Thu, 5 Sep 2002, Larry Hall (RFK Partners, Inc) wrote:

> At 10:19 PM 9/5/2002, luke.kendall@cisra.canon.com.au wrote:
> >  Subject: Re: Can't write .profile from vi
> >
> >On  6 Sep, I wrote:
> > >  Thanks for the thought, but of course the :w! doesn't work (that was
> > >  the first thing I tried), and as I said, I can write other files in my
> > >  home directory (which is a local directory on the PC, not a network
> > >  share or anything, BTW).  I can also do this:
> > >
> > >       :w xxx
> > >       :q
> > >       cp xxx .profile
> >
> >Actually, vi won't let me write any existing file whose name starts with
> >a ".".  The error is always "E212: Can't open file for writing"
> >
> >It only affects existing dot files.  And yes, I have write permission
> >for them all.  (I can edit them with vi by writing them to a file ~/xxx
> >and copying that over the top of the file.)
> >
> >This is on WindowsXP on a FAT32 file system.
> >
> >Even stranger, is the fact that I can create new dot files (e.g. .xxx),
> >and write them.  I can then copy an old dotfile over .xxx and write
> >.xxx; and copy .xxx over .xinitrc.  But I still can't write .xinitrc
> >from inside vi.
> >
> >What *does* work is this:
> >
> >         cp .xinitrc .xxx
> >         rm .xinitrc
> >         mv .xxx .xinitrc
> >
> >*Then* I can edit .xinitrc and write it.
> >
> >The "rm" seemed to have a slightly different noise to other rms; it
> >sounded like there was a little more disc access, and it took a
> >fraction of a second longer.
> >
> >Anyway, I'll wait a couple of days in case anyone would like me to try
> >some diagnostics.  Failing that, I'll just write a script that applies
> >the above workaround and I'll be happy; though diagnosing the Cygwin
> >problem may then become impossible.
>
>
> I pulled this from your previous email:
>
> $ grep luke /etc/passwd
> luke:unused_by_nt/2000/xp:11021:10513:Luke Kendall,U-CISRA\luke,S-1-5-21-5706737
> -76180391-208020174-1021:/home/luke:/bin/bash
> lukep:unused_by_nt/2000/xp:12898:10513:Luke Paton,U-CISRA\lukep,S-1-5-21-5706737
> -76180391-208020174-2898:/home/lukep:/bin/bash
> $ ls -aln ~/.profile
> -rwxr-xr-x    1 11021    10513        4327 Aug 30 10:40 /home/luke/.profile
>
>
> Your uid (11021) and SID (S-1-5-21--76180391-208020174-1021) don't match.
> Are you sure this was generated by mkpasswd?  You'll want to double check
> this and the difference in ownership and permissions between the files that
> vi is working with and those (like .profile) that it's not.  I expect you'll
> see a difference there.  It's worth keeping in mind as well that the user
> your trying to be in this case is a domain user.  While this isn't a no-no,
> it does come with some extra potential "gotchas" which I alluded to above
> and which are covered in the email archives.  But start with these checks
> and make sure something here doesn't signal the problem.

Actually, the mismatching ids are fine - this is what mkpasswd generates
for domain users.  This might, however, be the reason why this is
failing...  Is your home directory on a network drive, by any chance?
I've had some permission troubles with samba drives and cygwin...
What's the output of 'id' for you, by the way?
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

It took the computational power of three Commodore 64s to fly to the moon.
It takes a 486 to run Windows 95.  Something is wrong here. -- SC sig file


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]