<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Long Paths in .NET, Part 3 of 3 [Kim Hamilton]</title><link>http://blogs.msdn.com/bclteam/archive/2008/06/10/long-paths-in-net-part-3-of-3-kim-hamilton.aspx</link><description>Updated 6/10/08 2:20pm: clarified details of proposed solution Here it is, Part 3 of the long path series , which started over a year ago. I apologize for leaving you hanging; the BCL team has been busy lighting up the web . Because of the delay, I’ll</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>BCL Team Blog : Long Paths in .NET, Part 2 of 3: Long Path Workarounds [Kim Hamilton]</title><link>http://blogs.msdn.com/bclteam/archive/2008/06/10/long-paths-in-net-part-3-of-3-kim-hamilton.aspx#8590010</link><pubDate>Tue, 10 Jun 2008 18:07:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8590010</guid><dc:creator>BCL Team Blog : Long Paths in .NET, Part 2 of 3: Long Path Workarounds [Kim Hamilton]</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/bclteam/archive/2007/03/26/long-paths-in-net-part-2-of-3-long-path-workarounds-kim-hamilton.aspx"&gt;http://blogs.msdn.com/bclteam/archive/2007/03/26/long-paths-in-net-part-2-of-3-long-path-workarounds-kim-hamilton.aspx&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Long Paths in .NET, Part 3 of 3 [Kim Hamilton]</title><link>http://blogs.msdn.com/bclteam/archive/2008/06/10/long-paths-in-net-part-3-of-3-kim-hamilton.aspx#8590197</link><pubDate>Tue, 10 Jun 2008 20:21:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8590197</guid><dc:creator>Mike</dc:creator><description>&lt;p&gt;Hmm, using short file names sounds more like a hack than a real solution.&lt;/p&gt;
&lt;p&gt;For one thing short file names exist in Window just for the sake of compatibility. Using what is basically an obsolete feature of Windows to &amp;quot;fix&amp;quot; .NET which is supposed to be &amp;quot;the future&amp;quot; sounds backwards to me.&lt;/p&gt;
&lt;p&gt;Second don't be so quick to assume that turning off short filename generation is uncommon. Generation of such names is known to slow things down so don't be too surprised if people turn it off. Even if they don't know how to do it some enterprising person may include this feature in an &amp;quot;optimization&amp;quot; tool and spread it across. This means that .NET developers won't be able to relay on this &amp;quot;fix&amp;quot; working on every computer.&lt;/p&gt;
&lt;p&gt;Here's a case where people had to turn short name generation off because of performance issues: &lt;a rel="nofollow" target="_new" href="http://channel9.msdn.com/forums/TechOff/407930-SQL-Server-2008-CTP-FILESTREAM--NTFS-limitations/"&gt;http://channel9.msdn.com/forums/TechOff/407930-SQL-Server-2008-CTP-FILESTREAM--NTFS-limitations/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If .NET framework is to fix this somehow I think it is better to simply allow \\?\ (even if this will need full trust to work). This will put .NET framework on par with Win32 and who knows, maybe one day Win32 will increase the limit and limit the need for \\?\.&lt;/p&gt;
</description></item><item><title>re: Long Paths in .NET, Part 3 of 3 [Kim Hamilton]</title><link>http://blogs.msdn.com/bclteam/archive/2008/06/10/long-paths-in-net-part-3-of-3-kim-hamilton.aspx#8590263</link><pubDate>Tue, 10 Jun 2008 21:15:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8590263</guid><dc:creator>Kim Hamilton</dc:creator><description>&lt;p&gt;Before you start throwing around the word &amp;quot;hack&amp;quot; you might re-read and notice that I also proposed we support \\?\. :) However, we would not prepend this automatically behind the scenes and it would require some (tbd) heavier demand than FileIOPermissions. &lt;/p&gt;
&lt;p&gt;The auto-shrinking case is what we could attempt behind the scenes to soften the impact for the &amp;quot;slightly above&amp;quot; cases, where users don't necessarily want to get into the world of \\?\.&lt;/p&gt;
</description></item><item><title>re: Long Paths in .NET, Part 3 of 3 [Kim Hamilton]</title><link>http://blogs.msdn.com/bclteam/archive/2008/06/10/long-paths-in-net-part-3-of-3-kim-hamilton.aspx#8590373</link><pubDate>Tue, 10 Jun 2008 23:27:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8590373</guid><dc:creator>Eric</dc:creator><description>&lt;p&gt;Put me down as a strong &amp;quot;no&amp;quot; for this approach. &lt;/p&gt;
&lt;p&gt;The fact that Windows allows users to turn off short file names should be reason enough. I might be wrong, but short file names were basically a kludge added for backwards-compatibility in Windows 95. It's even further moved into the &amp;quot;compatibility&amp;quot; realm when dealing with Windows NT based operating systems.&lt;/p&gt;
&lt;p&gt;One thing I've been very happy about over the years is that short filenames are effectively &amp;quot;dead&amp;quot; - nothing uses them by choice any longer. &lt;/p&gt;
&lt;p&gt;Adding it to .NET to support a fringe case (path lenghts &amp;gt; MAX_PATH) will effectively make it a &amp;quot;core case&amp;quot; - something that all applications will start using. Effectively, you will be reintroducing the &amp;quot;hell&amp;quot; (no offense) of short paths to the world once again.&lt;/p&gt;
&lt;p&gt;I've seen existing bugs in .NET (can't remember which classes) where it &amp;quot;faked&amp;quot; short paths by truncating then concatenating ~1 to the end - regardless of what the underlying filesystem will do. You have no guaruntee before you touch the NTFS filesystem that it *really* will turn into ~1 in the Win95 days files with the same beginning would become ~2, ~3, etc. This is the deal breaker - you cannot guaruntee compatibility as long as this is true. If I have a directory called &amp;quot;Program Files&amp;quot; and another called &amp;quot;Program Data&amp;quot;, your algorithm will specify the wrong one! You will not know if the directory is PROGRA~1 or PROGRA~2 before you make the API call unless you make other I/O requests to the NTFS / storage system.&lt;/p&gt;
&lt;p&gt;As stated in your post - the BCL is effectively limited by what the Win32 API has done (inconsistent \\?\ support). Why is this any different than what Win32 API developers face? They have the same issues - some support long paths, some do not. &lt;/p&gt;
&lt;p&gt;I'd rather see a &amp;quot;modern&amp;quot; solution that follows the recommended practice set out by the Operating System (Kernel) guys. That practice is to use \\?\, not introduce kludges that are only there for backwards compatibility with DOS.&lt;/p&gt;
&lt;p&gt;&amp;quot;Shrinking&amp;quot; paths will be a *LOT* scarier (conceptually) for a developer than having to know which paths are supported in which context. &lt;/p&gt;
&lt;p&gt;It still doesn't fully work around the MAX_PATH issue either - the developers who are asking for a workaround for MAX_PATH are envisioning \\?\, which is not the same as using short filenames to have &amp;quot;a bit more room&amp;quot;. They want the full meal deal, not a faked version. &lt;/p&gt;
&lt;p&gt;And if you're not satisfying the core audience who are requesting this feature, why would you introduce a &amp;quot;DOS&amp;quot; kludge into .NET? It just doesn't make sense.&lt;/p&gt;
</description></item><item><title>re: Long Paths in .NET, Part 3 of 3 [Kim Hamilton]</title><link>http://blogs.msdn.com/bclteam/archive/2008/06/10/long-paths-in-net-part-3-of-3-kim-hamilton.aspx#8590386</link><pubDate>Tue, 10 Jun 2008 23:35:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8590386</guid><dc:creator>Kim Hamilton</dc:creator><description>&lt;p&gt;Hmm, these comments are strange given that I propose explicit use of \\?\ should be allowed. Maybe people are skimming and not noticing? In any case, to avoid having to repeatedly say &amp;quot;read the blog&amp;quot; I'll make some updates to ensure that's clear.&lt;/p&gt;
</description></item><item><title>re: Long Paths in .NET, Part 3 of 3 [Kim Hamilton]</title><link>http://blogs.msdn.com/bclteam/archive/2008/06/10/long-paths-in-net-part-3-of-3-kim-hamilton.aspx#8590387</link><pubDate>Tue, 10 Jun 2008 23:37:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8590387</guid><dc:creator>Eric</dc:creator><description>&lt;p&gt;As an example to my previous post, try the following on Windows Vista:&lt;/p&gt;
&lt;p&gt;* Open Command Prompt&lt;/p&gt;
&lt;p&gt;* Change directory to C:\&lt;/p&gt;
&lt;p&gt;* Type &amp;quot;dir /a /x&amp;quot;&lt;/p&gt;
&lt;p&gt;Notice the short filenames displayed? On my machine, &amp;quot;ProgramData&amp;quot; is &amp;quot;PROGRA~2&amp;quot;. &lt;/p&gt;
&lt;p&gt;With the proposed algorithm, the file:&lt;/p&gt;
&lt;p&gt;&amp;quot;C:\ProgramData\&amp;lt;really long path&amp;gt;\MyFile.txt&amp;quot; &lt;/p&gt;
&lt;p&gt;Would be translated into:&lt;/p&gt;
&lt;p&gt;&amp;quot;C:\PROGRA~1\&amp;lt;shrunk path components&amp;gt;\MyFile.txt&amp;quot;&lt;/p&gt;
&lt;p&gt;However, you now have non-deterministic behavior. The file will actually be saved as:&lt;/p&gt;
&lt;p&gt;&amp;quot;C:\Program Files\&amp;lt;really long path&amp;gt;\MyFile.txt&amp;quot;, which is not what the developer intended.&lt;/p&gt;
&lt;p&gt;That said, perhaps additional API calls will be used to perform the actual translation and &amp;quot;lookup&amp;quot; pre-existing files. &lt;/p&gt;
&lt;p&gt;However, wouldn't the proposed behavior still be non-deterministic for files being created? &lt;/p&gt;
</description></item><item><title>re: Long Paths in .NET, Part 3 of 3 [Kim Hamilton]</title><link>http://blogs.msdn.com/bclteam/archive/2008/06/10/long-paths-in-net-part-3-of-3-kim-hamilton.aspx#8590389</link><pubDate>Tue, 10 Jun 2008 23:40:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8590389</guid><dc:creator>Lionel</dc:creator><description>&lt;p&gt;The solution using short names looks messy, and IMHO it might look safer in the short term, but it has a lot of potential for creating compatibility nightmares in the long term. &amp;nbsp;It makes path canonicalization even more complicated, it would have a cost in performances by requiring disk access or an in-memory cache for short names lookups, whether path are too long would depend on the length of usually hidden short names, and it will often end up in displayed paths and a poorer user experience.&lt;/p&gt;
&lt;p&gt;I agree with Mike's description: it's a hack. &amp;nbsp;Granted, it's an attractive one, which would work in the short term, but you will end up paying the &amp;quot;long paths tax&amp;quot; later, and it will be more expensive.&lt;/p&gt;
&lt;p&gt;My advice would be to start supporting long path using \\?\ and optional canonicalization in .Net, and push for legacy applications to be upgraded (starting by Windows components and APIs). &amp;nbsp;It will take somewhat longer, but you will end up with less clutter in your code base, and less nightmares with unintuitive behaviors in applications. &amp;nbsp;Moreover, it would not be that bad: long paths are still uncommon, not a critical feature, and once the basics tools (especially Windows Explorer) support them, there will be a clear reason for third parties to start supporting them.&lt;/p&gt;
&lt;p&gt;Do not forget, too, that not supporting long paths often mean static buffers, potential overflows truncations or error cases, and thus an area where security vulnerabilities could creep in.&lt;/p&gt;
</description></item><item><title>re: Long Paths in .NET, Part 3 of 3 [Kim Hamilton]</title><link>http://blogs.msdn.com/bclteam/archive/2008/06/10/long-paths-in-net-part-3-of-3-kim-hamilton.aspx#8590401</link><pubDate>Tue, 10 Jun 2008 23:48:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8590401</guid><dc:creator>Lionel</dc:creator><description>&lt;p&gt;Kim,&lt;/p&gt;
&lt;p&gt;Whether you allow \\?\ in parallel with path shrinking is mostly irrelevant. &amp;nbsp;You would still be introducing more complex path handling rules, relying on short names, and add a lot of potential complexity in .Net's behaviour. &amp;nbsp;The drawbacks are still there.&lt;/p&gt;
&lt;p&gt;Moreover, if you give a simple, partial solution and a solid, harder to use one, most programmers will choose the first. &amp;nbsp;The option to explicitly use of \\?\ would be mostly ignored. &amp;nbsp;On the other hand, if you focus on using \\?\ behind the scene, you could try to create an easy to use, cleaner API, and try to hind the quirks of the underlying Win32 calls.&lt;/p&gt;
</description></item><item><title>re: Long Paths in .NET, Part 3 of 3 [Kim Hamilton]</title><link>http://blogs.msdn.com/bclteam/archive/2008/06/10/long-paths-in-net-part-3-of-3-kim-hamilton.aspx#8590451</link><pubDate>Wed, 11 Jun 2008 00:29:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8590451</guid><dc:creator>kimhamil</dc:creator><description>&lt;p&gt;Note that I rearranged the post to highlight that \\?\ is indeed part of the solution and that auto-shrinking helps &amp;quot;make it work&amp;quot; for opening existing files when \\?\ is not used. &lt;/p&gt;
&lt;p&gt;I have to agree that my mention of \\?\ support was rather buried before -- basically it was the closing sentence of the &amp;quot;solution&amp;quot; part. I guess I can't expect everyone to pore over every sentence. Hope it's clearer now. :)&lt;/p&gt;
</description></item><item><title>re: Long Paths in .NET, Part 3 of 3 [Kim Hamilton]</title><link>http://blogs.msdn.com/bclteam/archive/2008/06/10/long-paths-in-net-part-3-of-3-kim-hamilton.aspx#8590529</link><pubDate>Wed, 11 Jun 2008 01:44:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8590529</guid><dc:creator>Max Christian</dc:creator><description>&lt;p&gt;Please be aware that 8.3 filename generation has to be disabled for any application that creates and reads files rapidly, and has more than a few thousand files per directory. &amp;nbsp;Otherwise the performance is terrible -- there is a KB about it which I can't find right now.&lt;/p&gt;
&lt;p&gt;So disabling 8.3 generation is much more common than you might think.&lt;/p&gt;
</description></item><item><title>re: Long Paths in .NET, Part 3 of 3 [Kim Hamilton]</title><link>http://blogs.msdn.com/bclteam/archive/2008/06/10/long-paths-in-net-part-3-of-3-kim-hamilton.aspx#8590535</link><pubDate>Wed, 11 Jun 2008 01:55:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8590535</guid><dc:creator>Thomas Krause</dc:creator><description>&lt;p&gt;IMO you should prepend \\?\ automatically for all .NET APIs that support it (but still enforcing the other path restrictions of course). .NET APIs that wrap Win32 functions without \\?\ support, should use the proposed automatic path shrinking if the path is too long, so that they'll be also able to handle long paths whenever possible.&lt;/p&gt;
&lt;p&gt;Of course you will still have problems with other applications that don't support long file paths, but these applications would not work with path shrinking either, if they don't shrink paths themself.&lt;/p&gt;
&lt;p&gt;Also while the proposed solution will only work if short file name generation is not deactivated, this solution would still be able to work in most (or many) cases.&lt;/p&gt;
&lt;p&gt;What do you think?&lt;/p&gt;
</description></item><item><title>re: Long Paths in .NET, Part 3 of 3 [Kim Hamilton]</title><link>http://blogs.msdn.com/bclteam/archive/2008/06/10/long-paths-in-net-part-3-of-3-kim-hamilton.aspx#8590599</link><pubDate>Wed, 11 Jun 2008 03:16:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8590599</guid><dc:creator>Dean Harding</dc:creator><description>&lt;p&gt;Eric, I don't think you understand the algorithm that is being proposed. It wouldn't be blindly truncating and appending &amp;quot;~1&amp;quot; to the file name. It would use the *correct* short name for a given long name. I can't believe how anybody could imagine it working any other way.&lt;/p&gt;
&lt;p&gt;As to the original question, given that \\?\ will be supported anyway, I'm not sure what the benefit of path shrinking would be. It would work some times, but not all times, and so you'd still need to work around the times it doesn't work with \\?\.&lt;/p&gt;
&lt;p&gt;I think path shrinking should be limited only to those cases that won't be fixable by supporting \\?\ -- namely LoadLibrary and that sort of thing.&lt;/p&gt;
</description></item><item><title>re: Long Paths in .NET, Part 3 of 3 [Kim Hamilton]</title><link>http://blogs.msdn.com/bclteam/archive/2008/06/10/long-paths-in-net-part-3-of-3-kim-hamilton.aspx#8590714</link><pubDate>Wed, 11 Jun 2008 05:42:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8590714</guid><dc:creator>orcmid</dc:creator><description>&lt;p&gt;First, I think this is a great discussion to also reflect on the MSDN Technical Interoperability Forum, because I suspect there are many more things that haven't been thought about, and attracting more eyeballs could be valuable.&lt;/p&gt;
&lt;p&gt;With regard to short names, I think people don't get that the short names are always there (right?) for any non-short name of a directory or a file. &amp;nbsp;Nicht wahr? &amp;nbsp;You want to see some, run edit.com (yes, that one) from a console window. &amp;nbsp;Then notice what the console shows as the current directory path afterwards. &amp;nbsp;(So would we be breaking cmd.exe with this stuff?)&lt;/p&gt;
&lt;p&gt;The interoperability issues I am thinking of have to do with (1) shared directories that have these monster name snakes in them, (2) software that reads and writes related formats, such as ISO CD-ROMs and DVDs. &amp;nbsp;Oh, yes, ahem, flash drives and that Windows Home Server on my workgroup LAN. There are APIs that have hard-coded limits for passing filenames back and forth too (there are ones in ODMA that I am probably too familiar with).&lt;/p&gt;
&lt;p&gt;Then there are all those web file uploaders and downloaders, etc., etc. &amp;nbsp;Probably one more way to break Media Player in an inscrutible way, etc.&lt;/p&gt;
&lt;p&gt;I hope the wider conversation around this happened internally (on that internal list you mentioned in one of these posts). &amp;nbsp;Is there some place where people triage things that will cost more in support incidents than the problem they solve?&lt;/p&gt;
&lt;p&gt;Hmm, yes, I think this goes onto the Technical Interoperability forum and maybe some wider readership, though not sure what that is.&lt;/p&gt;
</description></item><item><title>re: Long Paths in .NET, Part 3 of 3 [Kim Hamilton]</title><link>http://blogs.msdn.com/bclteam/archive/2008/06/10/long-paths-in-net-part-3-of-3-kim-hamilton.aspx#8590747</link><pubDate>Wed, 11 Jun 2008 06:19:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8590747</guid><dc:creator>Dean Harding</dc:creator><description>&lt;p&gt;orcmid: Notice the comments above about how short name generation can be turned off. While it's true that turning off short name generation won't delete the short names that *already exist*, it obviously won't generate any new ones, so it'll only help you in some situations.&lt;/p&gt;
&lt;p&gt;I believe the main problem with shrinking the paths is that it only works some of the time, and it's totally arbitrary whether it'll work on any given path (so your application might be OK on an operating system that has short name generation turned on, but if your customer has it turned off, it might not work for them... I imagine it's going to be very difficult to track those sorts of problems down -- better to fail consistently).&lt;/p&gt;
</description></item><item><title>re: Long Paths in .NET, Part 3 of 3 [Kim Hamilton]</title><link>http://blogs.msdn.com/bclteam/archive/2008/06/10/long-paths-in-net-part-3-of-3-kim-hamilton.aspx#8590782</link><pubDate>Wed, 11 Jun 2008 06:58:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8590782</guid><dc:creator>Yggy</dc:creator><description>&lt;p&gt;As part of the long-term plan, have you considered deprecating strings-as-paths altogether and using the Uri class instead?&lt;/p&gt;
</description></item><item><title>NTFS Streams?</title><link>http://blogs.msdn.com/bclteam/archive/2008/06/10/long-paths-in-net-part-3-of-3-kim-hamilton.aspx#8591144</link><pubDate>Wed, 11 Jun 2008 13:52:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8591144</guid><dc:creator>David</dc:creator><description>&lt;p&gt;If you're changing the filename parsing in the BCL, what about allowing names that specify alternate NTFS streams? &amp;nbsp;i.e. c:\MyFile.Txt:extra_metadata&lt;/p&gt;
&lt;p&gt;At the moment (well, last time I tried) it will get upset about the extra : character.&lt;/p&gt;
</description></item><item><title>MATTER SIZES, aka Knowing when to unflip a[n inappropriately flipped] bozo bit</title><link>http://blogs.msdn.com/bclteam/archive/2008/06/10/long-paths-in-net-part-3-of-3-kim-hamilton.aspx#8591870</link><pubDate>Wed, 11 Jun 2008 21:28:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8591870</guid><dc:creator>Sorting it all Out</dc:creator><description>&lt;p&gt;The source of the main title is an inside joke I am probably not going to ever explain within the blog.&lt;/p&gt;
</description></item><item><title>re: Long Paths in .NET, Part 3 of 3 [Kim Hamilton]</title><link>http://blogs.msdn.com/bclteam/archive/2008/06/10/long-paths-in-net-part-3-of-3-kim-hamilton.aspx#8591881</link><pubDate>Wed, 11 Jun 2008 21:37:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8591881</guid><dc:creator>Peter</dc:creator><description>&lt;p&gt;Firstly, just swapping one very large limit for another isn't really going to solve the problem. &amp;nbsp;People would simply start using very, very long directory names (think of how long URLs get when you start adding on form data -- and a couple of guids -- and a session id -- and the date -- and, and, and). &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Secondly, making the limit bigger imposes horrid problems on small devices. &amp;nbsp;My kids have some &amp;quot;clock radios&amp;quot; that can play MP3 files (currently favorite: Oliver!). &amp;nbsp;These have enough trouble with MAX_PATH names. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thirdly, path names also have to fit into the user interface. &amp;nbsp;The Explorer in Vista already has enormous troubles with the existing path sizes; the last thing it needs is to have more troubles.&lt;/p&gt;
&lt;p&gt;Lastly, stop it, stop it, stop it. &amp;nbsp;File paths are a SYSTEM thing to be solved by the SYSTEM groups. &amp;nbsp;The last (deleted) thing I need to deal with is a zillion (deleted) &amp;quot;solutions&amp;quot; by a zillion (deleted) groups, all &amp;quot;solving&amp;quot; the problem in their own, incompatible way.&lt;/p&gt;
&lt;p&gt;Suppose you DO come up with a &amp;quot;solution&amp;quot;. &amp;nbsp;How will my C++ app deal with it? &amp;nbsp;Will I have to make a call from C++ into .Net just to call your lame API? &amp;nbsp;How will I do it from my installer? &amp;nbsp;Can I do it from the Java program that runs my builds?&lt;/p&gt;
</description></item><item><title>re: Long Paths in .NET, Part 3 of 3 [Kim Hamilton]</title><link>http://blogs.msdn.com/bclteam/archive/2008/06/10/long-paths-in-net-part-3-of-3-kim-hamilton.aspx#8592128</link><pubDate>Wed, 11 Jun 2008 23:41:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8592128</guid><dc:creator>orcmid</dc:creator><description>&lt;p&gt;Urk about short-name generation being disabled.&lt;/p&gt;
&lt;p&gt;So, I agree, this is a SYSTEM issue and in particular a matter with regard to the file system. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;I guess I don't know what the use case is that has exceeding MAX_PATH be locally useful while remaining globally safe. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;More fodder: Zip files and directory-simulating Zip access,&lt;/p&gt;
&lt;p&gt;and then there's the part: protocol and OPC&lt;/p&gt;
&lt;p&gt;um, the file: URI,&lt;/p&gt;
&lt;p&gt;oh, and who gets to figure out all the threat-modeling of this combined with NTFS streams, hiding root kits, etc.&lt;/p&gt;
&lt;p&gt;and what about using long-path injection as a form of buffer-overrun exploit, although I suspect that would be hard (assuming the Win32 APIs never change and neither does the MAX_PATH constant, for obvious down-level protection reasons).&lt;/p&gt;
&lt;p&gt;Just tossing things around here. &amp;nbsp;The bigger problem with this conversation is that the inside one is completely separated from the outside one and who knows what well-trodden ground we are revisiting. &amp;nbsp;So I think I will shut up now. &amp;nbsp;I hate write-only feedback channels.&lt;/p&gt;
</description></item><item><title>re: Long Paths in .NET, Part 3 of 3 [Kim Hamilton]</title><link>http://blogs.msdn.com/bclteam/archive/2008/06/10/long-paths-in-net-part-3-of-3-kim-hamilton.aspx#8592834</link><pubDate>Thu, 12 Jun 2008 11:29:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8592834</guid><dc:creator>Jon Grant</dc:creator><description>&lt;p&gt;I think you're overanalysing this WAY too much.&lt;/p&gt;
&lt;p&gt;The fundamental problem is that .NET says that &amp;quot;?&amp;quot; is invalid in a path. &amp;nbsp;Remove that restriction. &amp;nbsp;That's all you need to do.&lt;/p&gt;
&lt;p&gt;&amp;quot;Oh but developers might create paths with invalid characters and spaces at the end!&amp;quot;&lt;/p&gt;
&lt;p&gt;SO WHAT! &amp;nbsp;Stop holding our hand. &amp;nbsp;.NET is not VBScript for dummies. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Right now, we are forced to re-implement the whole System.IO namespace purely to get over this shortsighted and rediculous piece of validation. &amp;nbsp;In fact, I don't see wht the framework has to validate paths at all: just pass it down to the API and let it throw an error if it's not happy with it. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Stop nannying us. &amp;nbsp;We're not idiots. &amp;nbsp;Stop making assumptions on our behalf.&lt;/p&gt;
</description></item><item><title>re: Long Paths in .NET, Part 3 of 3 [Kim Hamilton]</title><link>http://blogs.msdn.com/bclteam/archive/2008/06/10/long-paths-in-net-part-3-of-3-kim-hamilton.aspx#8593060</link><pubDate>Thu, 12 Jun 2008 15:56:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8593060</guid><dc:creator>akraus1</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I tried you sample code from your blog but I cannot get it to work on XP SP2. Is the \\?\ mechanism not supported for really long file names?&lt;/p&gt;
&lt;p&gt; &amp;nbsp;StringBuilder sb = new StringBuilder(&amp;quot;C:\\SubDir\\SubDir&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for(int i=0;i&amp;lt;60;i++)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sb.Append(&amp;quot;FileName&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sb.Append(&amp;quot;.txt&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; LongWriter.TestCreateAndWrite(sb.ToString());&lt;/p&gt;
&lt;p&gt;The Directory does already exist. I get as return value: The filename, directory name, or volume label syntax is incorrect.&lt;/p&gt;
&lt;p&gt;Is there a known limitation with the \\?\ approach?&lt;/p&gt;
&lt;p&gt;Yours,&lt;/p&gt;
&lt;p&gt; &amp;nbsp;Alois Kraus&lt;/p&gt;
</description></item><item><title>re: Long Paths in .NET, Part 3 of 3 [Kim Hamilton]</title><link>http://blogs.msdn.com/bclteam/archive/2008/06/10/long-paths-in-net-part-3-of-3-kim-hamilton.aspx#8593116</link><pubDate>Thu, 12 Jun 2008 16:42:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8593116</guid><dc:creator>akraus1</dc:creator><description>&lt;p&gt;Ahh found the issue. The fsutil command did lead the way:&lt;/p&gt;
&lt;p&gt;C:\&amp;gt;fsutil fsinfo volumeinfo c:\&lt;/p&gt;
&lt;p&gt;Volume Name : System&lt;/p&gt;
&lt;p&gt;Volume Serial Number : 0xf43ee3c8&lt;/p&gt;
&lt;p&gt;Max Component Length : 255&lt;/p&gt;
&lt;p&gt;File System Name : NTFS&lt;/p&gt;
&lt;p&gt;Supports Case-sensitive filenames&lt;/p&gt;
&lt;p&gt;Preserves Case of filenames&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;It seems that the directory name or file name itself cannot be longer than 255 characters. The 32K limit apply for the full path but the path parts itself cannot be longer than 255 characters still.&lt;/p&gt;
&lt;p&gt;Yours,&lt;/p&gt;
&lt;p&gt; &amp;nbsp;Alois Kraus&lt;/p&gt;
</description></item></channel></rss>