M
Martin Carpella
Hi!
I know, that Path-names should be shorter than MAX_PATH (250), but the
Win32-SDK allows specifiying longer names using the "\\?\" prefix.
As I have an application that accesses files directly using the volume
name instead of the drive letter
(i.e. "\\?\Volume{...}\subdir\file.ext"), I sometimes get an
PathTooLongException, as the total string exceeds 260 characters (due to
the "\\?\Volume{...}\"-part).
Is there any way, to get Path.GetDirectoryName() to honor the "\\?\"
prefix and therefore skip the check for MAX_PATH?
I find it interesting, that GetDirctoryName() and GetFullPath() are the
only two methods checking for the path length, Path.Combine(),
Path.GetFileName(), etc. all work without any problem with the long strings.
Best regards,
Martin
PS: Unfortunately it is no option to use the aliased path ("C:\...")
instead of the full path, as the Path is handed to the application from
external.
I know, that Path-names should be shorter than MAX_PATH (250), but the
Win32-SDK allows specifiying longer names using the "\\?\" prefix.
As I have an application that accesses files directly using the volume
name instead of the drive letter
(i.e. "\\?\Volume{...}\subdir\file.ext"), I sometimes get an
PathTooLongException, as the total string exceeds 260 characters (due to
the "\\?\Volume{...}\"-part).
Is there any way, to get Path.GetDirectoryName() to honor the "\\?\"
prefix and therefore skip the check for MAX_PATH?
I find it interesting, that GetDirctoryName() and GetFullPath() are the
only two methods checking for the path length, Path.Combine(),
Path.GetFileName(), etc. all work without any problem with the long strings.
Best regards,
Martin
PS: Unfortunately it is no option to use the aliased path ("C:\...")
instead of the full path, as the Path is handed to the application from
external.