How to test for Path Too Long?
-
I'd like to ensure a string I'm manipulating has not become too long to be a valid path. Can anyone shed some light on this for me? Thanks, Jeff
Most win32 c++ compilers have a _MAX_PATH constant defined - I'd search the Web/MSDN and see what this is defined as ... I would have thought VB had a function sitting over a win32 api that returns a path, the MSDN specs for that API should eventually yield that max it returns ... ps .. I took this >> from the MSDN CreateDirectory API page (The GetCurrentDirectory function doesnt show what you're looking for, unfortunately) .. "There is a default string size limit for paths of 248 characters. This limit is related to how the CreateDirectory function parses paths. To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend "\\?\" to the path. For more information, see Naming a File." so depending on what you define _MAX_PATH to be, you can just check the string length against it .. Sorry, that probably doesnt help much