Converting an application to support long path names.

%3CLINGO-SUB%20id%3D%22lingo-sub-1394533%22%20slang%3D%22en-US%22%3EConverting%20an%20application%20to%20support%20long%20path%20names.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1394533%22%20slang%3D%22en-US%22%3E%3CP%3EQuestion%201%3A%20(I%20think%20this%20might%20be%20an%20easy%20question%20-%20question%202%20below%20is%20harder).%3CBR%20%2F%3EI%20am%20using%20the%20Long%20Path%20Name%20feature%20on%20Windows%2010%2C%20and%20other%20platforms.%3C%2FP%3E%3CP%3EThe%20code%20base%20supports%20multiple%20platforms%20and%20operating%20systems.%20Other%20platforms%20already%20support%20path%20names%20longer%20than%20260%20characters.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EIn%20particular%2C%20I%20need%20to%20know%20how%20to%20convert%20a%20relative%20path%20to%20a%20fully%20qualified%20path%2C%20and%2For%20if%20applicable%2C%20a%20fully%20qualified%20path%20and%20file%20name.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EThe%20current%20directory%20could%20be%20either%20a%20long%20or%20short%20path.%20The%20relative%20directory%2C%20with%20the%20form%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E.%5Csome_relative_path%5Cwith_many_subdirectories%5Cand_on_and_on%5C%3C%2FP%3E%3CP%3Ecould%20also%20either%20be%20a%20short%20path%20or%20a%20long%20path.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EI%20know%20the%20directory%20names%20and%20files%20names%20can%20only%20be%20255%20characters%20maximum.%3C%2FP%3E%3CP%3EI%20know%20how%20to%20enable%20long%20path%20name%20support%20in%20the%20registry%2C%20and%2For%20group%20policy%20editor%2C%20and%20how%20to%20make%20long%20path%20name%20manifest%20files%20for%20my%20application.%20I%20also%20know%20to%20put%20the%20wide%20character%20form%20of%20%22%5C%5C%3F%5C%22%20-%20which%20in%20C%20is%20L%22%5C%5C%5C%5C%5C%3F%5C%5C%22%20in%20front%20of%20an%20absolute%20path.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EI%20am%20confused%20about%20how%20to%20get%20the%20fully%20qualified%20path%20when%20in%20a%20current%20directory.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EI%20see%20the%20GetFullPathNameW%20function%20is%20supported.%20However%2C%20%22%5C%5C%3F%5C%22%20cannot%20be%20appended%20to%20a%20relative%20path.%20I'm%20guessing%20that%20isn't%20needed%2C%20because%20the%20function%20takes%20a%20buffer%20length.%20Is%20that%20the%20function%20I%20need%20to%20get%20a%20fully%20qualified%20path%3F%3CBR%20%2F%3E%3CBR%20%2F%3E----------------------------------------%3CBR%20%2F%3EQuestion%202%3A%3CBR%20%2F%3EI%20do%20not%20see%20the%20Win32%20function%20%22OpenEncryptedFileRawW%22%20listed%20for%20long%20path%20name%20support.%26nbsp%3B%20How%20do%20I%20modify%20code%20using%20that%20function%20to%20support%20long%20path%20names%3F%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Visitor

Question 1: (I think this might be an easy question - question 2 below is harder).
I am using the Long Path Name feature on Windows 10, and other platforms.

The code base supports multiple platforms and operating systems. Other platforms already support path names longer than 260 characters.

In particular, I need to know how to convert a relative path to a fully qualified path, and/or if applicable, a fully qualified path and file name.

The current directory could be either a long or short path. The relative directory, with the form:

.\some_relative_path\with_many_subdirectories\and_on_and_on\

could also either be a short path or a long path.

I know the directory names and files names can only be 255 characters maximum.

I know how to enable long path name support in the registry, and/or group policy editor, and how to make long path name manifest files for my application. I also know to put the wide character form of "\\?\" - which in C is L"\\\\\?\\" in front of an absolute path.

I am confused about how to get the fully qualified path when in a current directory.

I see the GetFullPathNameW function is supported. However, "\\?\" cannot be appended to a relative path. I'm guessing that isn't needed, because the function takes a buffer length. Is that the function I need to get a fully qualified path?

----------------------------------------
Question 2:
I do not see the Win32 function "OpenEncryptedFileRawW" listed for long path name support.  How do I modify code using that function to support long path names?


1 Reply
Highlighted
Use Long Path Tool, Long Path Tool can simplify and probably end your problems in unlocking, managing and renaming files that appear to have a long filename.