OT: Dumb Windows path parsing

Kenneth Brody kenbrody at bestweb.net
Mon Nov 28 19:38:17 PST 2005


Well, I've just come across a "strangeness" in how Windows parses
pathnames.  It turns out that "." and ".." are parsed before the
path is actually referenced.  In other words, ".." just removes
the lowest-level part of the current pathname without actually
checking that part.

For example, "c:\no\such\path\..\..\..\appl\bad_dir\..\fp" is the
same as "c:\appl\fp", even if no "\no" or "\appl\bad_dir" directories
exist.

You can also intersperse "." at will.

    c:\no\such\.\path\.\..\..\foo\..\.\..\appl\fp

Each "." is simply ignored, and each ".." moves "up" one "directory"
in the path that's being built.

--
KenBrody at BestWeb dot net        spamtrap: <g8ymh8uf001 at sneakemail.com>
http://www.hvcomputer.com
http://www.fileProPlus.com


More information about the Filepro-list mailing list