6
Shouts

Getting around PathTooLongException on file move with Windows Native API - .NET Development - Gal Ratner

published 462 days, 11 hours, 46 minutes ago posted by galratnergalratner 465 days, 38 minutes ago
Tuesday, February 15, 2011 7:56:46 PM GMT Sunday, February 13, 2011 7:05:10 AM GMT

If you ever got the error message “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. “ you are probably aware that there is no practical way of moving files with long paths using System.IO.File. The solution is to use the Native Windows API. You can see the API here: http://msdn.microsoft.com/en-us/library/aa364232(v=VS.85).aspx Here is a little...

category: Architecture | clicked: 1 | | source: galratner.com | show counter code
tags: Native API, C# .NET, IO

1 comment posted.

To post your comment please login or signup