This is going to sound nuts: 2 simultaneous versions of one fileunder Vista. - Editors

This is a discussion on This is going to sound nuts: 2 simultaneous versions of one fileunder Vista. - Editors ; Hi folks, I discovered to my utter dismay (well, more or less) that Vista is capable of maintaining 2 versions of the same file. It happened when I discovered a bug in GnuWin32's zlib's zconf.h file. You can reproduce this ...

+ Reply to Thread
Results 1 to 2 of 2

This is going to sound nuts: 2 simultaneous versions of one fileunder Vista.

  1. Default This is going to sound nuts: 2 simultaneous versions of one fileunder Vista.

    Hi folks,

    I discovered to my utter dismay (well, more or less)
    that Vista is capable of maintaining 2 versions of the
    same file. It happened when I discovered a bug in
    GnuWin32's zlib's zconf.h file.

    You can reproduce this for yourself (under Vista):

    1. Install GnuWin32's zlib from here:
    http://gnuwin32.sourceforge.net/packages.html
    2. Install the Windows version of Vim (the editor).
    3. Install Cygwin along with Vim.
    4. Use explorer to find the zconf.h file, and
    make any edit to it using the Windows version
    of Vim. It will be in at
    c:\Program Files\GnuWin32\include.
    5. Now start Cygwin i.e. BASH, go to the
    same directory and edit that file. You will
    discover that your previous edit was not made.
    6. Now using explorer open the same file in
    the Windows version of Vim. You will discover
    the indeed your edit was made.

    ....because 2 version of the file exist at
    the same time.

    I'd guess it's some kind of anti-virus functionality
    that was put into Vista so that a virus or
    trojan can think it damaged an important file
    i.e. something under Program Files, when
    every other program sees the original.

    Clever, but maddening if you need to fix
    a GnuWin32 bug (attempted access to
    nonexistent unistd.h).

  2. Default Re: This is going to sound nuts: 2 simultaneous versions of one file under Vista.

    table400@yahoo.com wrote in news:e494b246-026d-4358-8c20-9a8a27336d90
    @a70g2000hsh.googlegroups.com:

    > Hi folks,
    >
    > I discovered to my utter dismay (well, more or less)
    > that Vista is capable of maintaining 2 versions of the
    > same file. It happened when I discovered a bug in
    > GnuWin32's zlib's zconf.h file.

    <snip>

    > 4. Use explorer to find the zconf.h file, and
    > make any edit to it using the Windows version
    > of Vim. It will be in at
    > c:\Program Files\GnuWin32\include.


    There's your problem. The 'Program Files' directory is protected on
    Vista. Any changes are done in a shadow directory. (I forget the exact
    name, but if you open a command prompt and do a "dir /a/s \zconf.h"
    you'll find it - if I remember right, it's under \Users\<yourname>
    somewhere)

    <snip>
    > 6. Now using explorer open the same file in
    > the Windows version of Vim. You will discover
    > the indeed your edit was made.

    Yup, Windows is magically showing _your_ version of that file. If you
    logged in as another user, you would see the original. And since Cygwin
    doesn't go thru the registry for the redirection, then it doesn't see the
    altered file. (I believe if you open a cmd window, cd to the include
    directory and use vim, you'd also see the missing changes)

    First option is to install to some other directory then PF. Or, after
    installing, change the permissions on GnuWin32 to allow all users RW
    permission. (I forget exactly which permissions to change - I'm too lazy
    right now to boot up my vista machine)

    Dave Connet

+ Reply to Thread