title: Should I deal with files longer than MAX_PATH?
body: <p>Just had an interesting case.</p>
  
  <p>My software reported back a failure caused by a path being longer than MAX_PATH.</p>
  
  <p>The path was just a plain old document in My Documents, e.g.:</p>
  
  <pre><code>C:\Documents and Settings\Bill\Some Stupid FOlder Name\A really ridiculously long file thats really very very very..........very long.pdf
  </code></pre>
  
  <p>Total length 269 characters (MAX_PATH==260).</p>
  
  <p>The user wasn't using a external hard drive or anything like that. This was a file on an Windows managed drive.</p>
  
  <p>So my question is this. Should I care?</p>
  
  <p>I'm not saying <em>can</em> I deal with the long paths, I'm asking <em>should</em> I. Yes I'm aware of the "\?\" unicode hack on some Win32 APIs, but it seems this hack is not without risk (as it's changing the behaviour of the way the APIs parse paths) and also isn't supported by all APIs .</p>
  
  <p>So anyway, let me just state my position/assertions:</p>
  
  <ol>
  <li>First presumably the only way the user was able to break this limit is if the app she used uses the special Unicode hack. It's a PDF file, so maybe the PDF tool she used uses this hack.</li>
  <li>I tried to reproduce this (by using the unicode hack) and experimented. What I found was that although the file appears in Explorer, I can do nothing with it. I can't open it, I can't choose "Properties" (Windows 7). Other common apps can't open the file (e.g. IE, Firefox, Notepad). Explorer will also not let me create files/dirs which are too long - it just refuses. Ditto for command line tool cmd.exe.</li>
  </ol>
  
  <p>So basically, one could look at it this way: a rouge tool has allowed the user to create a file which is not accessible by a lot of Windows (e.g. Explorer). I could take the view that I shouldn't have to deal with this.</p>
  
  <p>(As an aside, this isn't an vote of approval for a short max path length: I think 260 chars is a joke, I'm just saying that if Windows shell and some APIs can't handle > 260 then why should I?).</p>
  
  <p>So, is this a fair view? Should I say "Not my problem"?</p>
  
  <p><em>UPDATE:</em> Just had another user with the same problem. This time an mp3 file. Am I missing something? How can these users be creating files that violate the MAX_PATH rule?</p>