"Virtualized" root directory on Windows (was Re: import/export)
Brian K. White
brian at aljex.com
Fri May 30 13:52:13 PDT 2014
On 5/30/2014 2:20 PM, Kenneth Brody wrote:
> On 5/30/2014 1:34 PM, Nancy Palmquist wrote:
>> You may have trouble writing to C:\ drive. Windows 7 does not usually
>> allow it.
> [...]
>
> Actually, it's a but more "interesting" than that.
>
> Windows will let (some?) programs create files in a "virtualized" root
> directory, which is in "%LOCALAPPDATA%\VirtualStore".
>
> When a console application tries to create a new file in the root directory,
> it will instead create it in the VirtualStore directory. When a console
> application tries to read a file from the root directory, it first looks in
> the VirtualStore directory, and if it's there, gets that one. If not, it
> will get the one from the "real" root directory, if any.
>
> This can lead to, umm... "fun" scenarios, such as two different versions of
> the apparently-same file.
>
> For example, "gvim c:\fppath" will show one file (it exists -- I created is
> as admin long ago), whereas "vim c:\fppath" will show a different one. The
> command "type \fppath" will show one version, and "cat \fppath" will show
> the other.
>
> I'm not sure how Windows determines which version the program will see, as
> filePro will see the "real" \fppath file. (It might be that gvim is marked
> as Windows 5.00, whereas filePro is Windows 5.01, but that's just an
> educated guess at this point.)
>
> But, imagine using "vim \fppath" to change where the file points, having
> filePro still using the old path (despite no PF* environment variables
> overriding it), using "type \fppath" to see that nothing changed, only to
> have "vim \fppath" show you the changes you made. Even more "fun" is when
> you rename "\fppath" to "\fppath.save", and "vim \fppath" still shows the
> file with your changes. (And, just to top things off, "gvim \fppath" show
> show a blank, "new file".)
>
Oh my freaking god... You'd think every single programmer in the entire
windows empire, even though they are windows programmers, should have
forseen exactly these kinds of problems and just told whoever proposed
this behavior that it's patently insane.
--
bkw
More information about the Filepro-list
mailing list