This is the mail archive of the cygwin 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]

Windows 7? Two different versions of a file depending on how it is accessed

I am seeing two different versions of a file depending on how I access
it.  Specifically, the file "C:\Program Files (x86)\Vim\_vimrc" uses
plain text to provide startup specifications for the text editor gvim.
 This is the standalone installation for Windows, not the one the one
that comes with Cygwin.  However, that is just the problem context.
The real issue is that I see two different versions of that file.  The
first version is the original one that came with the installation.  I
modified it by adding the lines:

   set guioptions-=m
   set guioptions-=T

I got a warning that the file is read-only.  It isn't according
read-only to "ls -l", but I thought that the discrepancy must have
been due to Windows 7's more complicated security (which I haven't
completely figured out).  I forced the save with "w!", tested it by
restarting gvim, and found that the settings did not take.  I wondered
whether the file actually contained the above two lines that I added.

It turns out that it depends on how the file is accessed.  If I access
the file using notepad or windows-based gvim, the two added lines are
not present (same thing if I use Windows's "more" from cmd.exe).  On
the other hand, if I access the file using vim or less from cygwin's
bash shell, the two added lines *are* present.  After googling about
different versions of files on Windows 7, I found that one possible
cause might be the backups that the OS makes.  However, I confirmed
that this particular file has no backups.

Right now, I am not sure whether this is a Windows 7 problem or a
cygwin problem (or more likely, an interaction between them).  Can
anyone suggest a next possible course of action?  I don't want to
force both copies to be the same by simply editting the file using the
Windows-base gvim.  This hides a problem that will doubtlessly come
back and cause great grief.

Problem reports:
Unsubscribe info:

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