1.7.1: XnView on Windows fails to open files when total path length is longer than 512 characters
Posted: Wed May 15, 2024 4:05 am
XnView MP 1.7.1 - 64-bit
Windows 10 - 64-bit
Greetings! I have many images nested inside folders with long descriptive folder names. When the total path length (folder length + filename length) is over 512 characters, XNview cannot open the images when double clicked in Windows Explorer.
Here are Windows console commands to reproduce the bug. This will create nested folders with two image files inside. One of the files has a total path length of 500 chars and the other's length is 512 chars.
Run all three commands in the console, and then try to open each image in Windows Explorer. Only one image successfully opens! The longer one crashes when double clicked. Is there a 512 char limit on the String variable for the filepath? Can it be increased, for example to 1024 chars?
mkdir "C:\Pictures\This_folder_name_is_220_characters_long_____________________________________________________________________________________________________________________________________________________________________________________\This_folder_name_is_220_characters_long_____________________________________________________________________________________________________________________________________________________________________________________"
copy "C:\Program Files\XnViewMP\FileIcons\bmp.ico" "C:\Pictures\This_folder_name_is_220_characters_long_____________________________________________________________________________________________________________________________________________________________________________________\This_folder_name_is_220_characters_long_____________________________________________________________________________________________________________________________________________________________________________________\This_file_path_is_500_chars_long__________.ico"
copy "C:\Program Files\XnViewMP\FileIcons\bmp.ico" "C:\Pictures\This_folder_name_is_220_characters_long_____________________________________________________________________________________________________________________________________________________________________________________\This_folder_name_is_220_characters_long_____________________________________________________________________________________________________________________________________________________________________________________\This_file_path_is_512_chars_long______________________.ico"
Windows 10 - 64-bit
Greetings! I have many images nested inside folders with long descriptive folder names. When the total path length (folder length + filename length) is over 512 characters, XNview cannot open the images when double clicked in Windows Explorer.
Here are Windows console commands to reproduce the bug. This will create nested folders with two image files inside. One of the files has a total path length of 500 chars and the other's length is 512 chars.
Run all three commands in the console, and then try to open each image in Windows Explorer. Only one image successfully opens! The longer one crashes when double clicked. Is there a 512 char limit on the String variable for the filepath? Can it be increased, for example to 1024 chars?
mkdir "C:\Pictures\This_folder_name_is_220_characters_long_____________________________________________________________________________________________________________________________________________________________________________________\This_folder_name_is_220_characters_long_____________________________________________________________________________________________________________________________________________________________________________________"
copy "C:\Program Files\XnViewMP\FileIcons\bmp.ico" "C:\Pictures\This_folder_name_is_220_characters_long_____________________________________________________________________________________________________________________________________________________________________________________\This_folder_name_is_220_characters_long_____________________________________________________________________________________________________________________________________________________________________________________\This_file_path_is_500_chars_long__________.ico"
copy "C:\Program Files\XnViewMP\FileIcons\bmp.ico" "C:\Pictures\This_folder_name_is_220_characters_long_____________________________________________________________________________________________________________________________________________________________________________________\This_folder_name_is_220_characters_long_____________________________________________________________________________________________________________________________________________________________________________________\This_file_path_is_512_chars_long______________________.ico"