-
Mar 13th, 2017, 09:10 AM
#1
Long Paths (>260) and Windows Explorer
Interesting, I'm just beginning to start testing some of my "Long Path" procedures. It's my understanding that Windows Explorer doesn't really like these, but that's okay. I'll work around that in my code.
However, I was just creating a long path for testing. Interestingly, Windows Explorer started using the 8.3 naming system when the folder paths got too long.
I don't have an easy way to turn the 8.3 off on my test system. I'm just wondering what happens if it'd been off. Here's a sample of a path that I'm now getting:
C:\Users\Elroy\Desktop\LONGPA~1\THISIS~1\AndYetAgainWeAreCreatingAVeryLongFolderNameSoAsToCreateAPat hThatIsLongerThanTheTwoHundredAndSixtyCharacterLimit
Notice the 8.3. That's not my doing. Windows Explorer did that all on its own.
So, what happens if 8.3 is turned off?
Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.
-
Mar 15th, 2017, 03:36 PM
#2
Re: Long Paths (>260) and Windows Explorer
Not sure you can 'turn it off'. A file can be referenced via its short or long path. In fact, there may be older drivers and applications that can't read long paths, paths/file names with spaces, etc. The short path, in that case, is the workaround. You can convert long to short via GetShortPathName API and convert from short to long via GetLongPathName.
Additionally, passing long paths to APIs that have a max character limit can be overcome, in many cases, by preceding the path with: \\?\. Note that this usually applies to the unicode APIs but, in any case, requires reading the limitations of whatever API the path is intended for.
-
Mar 15th, 2017, 05:20 PM
#3
Re: Long Paths (>260) and Windows Explorer
Welcome back foxy, good to see you again.
>Not sure you can 'turn it off'
8.3 filename support can be disabled on recent versions of Windows via use of the fsutil.exe cmd line utility. The feature is on by default for desktop versions and (it is said) off by default in server versions. When off ShortPathName only returns the LongPathName if it complies with an 8.3 spec, otherwise it returns a blank. Ref. http://blogs.msdn.com/b/winsdk/archi...path-name.aspx
-
Mar 16th, 2017, 09:34 AM
#4
Re: Long Paths (>260) and Windows Explorer
Sorry about the dead link in my last post here it is again https://blogs.msdn.microsoft.com/win...ort-path-name/
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|