Is File Path longer than 260 characters allowed in .Net 2.0 ?

In .net 1.1 I get a pathtoolongexception see here ....

"The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters."
from http://www.msdn.microsoft.com/library/default.asp url=/library/en-us/cpref/html/frlrfsystemiopathclassgetfullpathtopic.asp

Are longer paths/filenames allowed in version 2.0
There is an MS answer here
http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx feedbackid=273165a2-e097-468c-baaf-ffd69acc33f7
But it is a bit vague as to when they will fix it.

Have they fixed it in the beta 2
(I havn't got room/time to install VS2005 beta 2 to check myself)

Please let me know, thanks.


Answer this question

Is File Path longer than 260 characters allowed in .Net 2.0 ?

  • Gautam Ludhani

    Hello,

    Ever got this error
    The specified path, file name, or both are too long. The fully qualified
    file name must be less than 260 characters, and the directory name must be
    less than 248 characters.

    Since the .NET Framework does not support long filenames :-(
    I had to write a library that calls the WIN32 API and wraps those functions
    like System.IO.

    I have a solution to your problem!
    Delimon.Win32.IO replaces basic file functions of System.IO with long path
    names support for characters up to 32,767 Characters
    So bye bye MAX_PATH problem

    A new version is available now:
    - Added file/folder date changes
    - Added attributes support
    - Added Reading and Writing files

    A Win32Explorer is also available that lets you access long filenames in
    Windows

    You can download my library here:
    http://www.delimon.be


  • Bunce

  • Is File Path longer than 260 characters allowed in .Net 2.0 ?