Hi,

(This is a repost - I posted this last week, but
misspelled my email alias.)

The documentation states that this "exception is
thrown when a pathname or filename is longer than the
system-defined maximum length". In my case, this max.
length is 260 characters on WinXP. Is there any way to
change this value? If not, are there any workarounds?

Thanks,
Donald Xie

RE: System.IO.PathTooLongException by jiany

jiany
Tue Nov 18 21:22:28 CST 2003

Hi Donald,

Thank you for posting to the MSDN newsgroups.

Based on my research and experience, this issue is by design. Please refer
to the following URL:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemiodirectoryinfoclassctortopic.asp
"...
PathTooLongException
..
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 are too long. Paths must be less than
248 characters, and file names must be less than 260 characters.
.."

I will try my best to find if there is a work around for this issue. More
time is needed.

Best regards

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.


RE: System.IO.PathTooLongException by Donald

Donald
Tue Nov 18 22:27:09 CST 2003

Hi Jacob,

Thanks for the info. Yes it'd be great if there is a=20
workaround.

Thanks,
Donald Xie

>-----Original Message-----
>Hi Donald,
>
>Thank you for posting to the MSDN newsgroups.=20
>
>Based on my research and experience, this issue is by=20
design. Please refer=20
>to the following URL:
>
>http://msdn.microsoft.com/library/default.asp?
url=3D/library/en-us/cpref/html/
>frlrfsystemiodirectoryinfoclassctortopic.asp
>"...
>PathTooLongException
>...
>The specified path, file name, or both exceed the system-
defined maximum=20
>length. For example, on Windows-based platforms, paths=20
must be less than=20
>248 characters, and file names must be less than 260=20
characters.The=20
>specified path, file name, or both are too long. Paths=20
must be less than=20
>248 characters, and file names must be less than 260=20
characters.
>..."
>
>I will try my best to find if there is a work around for=20
this issue. More=20
>time is needed.
>
>Best regards
>
>Jacob Yang=20
>Microsoft Online Partner Support
>Get Secure! =A8C www.microsoft.com/security
>This posting is provided "as is" with no warranties and=20
confers no rights.
>
>.
>

RE: System.IO.PathTooLongException by jiany

jiany
Wed Nov 19 21:04:45 CST 2003

Hi Donald,

As I understand, you are looking for a way to change the "system-defined
maximum length".

I have done a lot of research regarding this issue. Unfortunately, I am
afraid that there is not a work around for this issue. This is a hardcoded
value in both the .NET Framework and the OS. The system APIs depend on
these hardcoded values so we cannot change them. From windef.h in Platform
SDK you could see MAX_PATH is defined as 260.

On the other hand, you can send your feedback/wi