1
0
Fork 0
mirror of https://github.com/DarkMatterCore/nxdumptool.git synced 2024-11-27 04:32:18 +00:00

Support for >260 char filenames on Windows

This commit is contained in:
bilditup1 2023-11-16 21:44:57 -05:00
parent 9272978039
commit 0f308da4d0

View file

@ -787,6 +787,10 @@ def usbHandleSendFileProperties(cmd_block: bytes) -> int | None:
# Generate full, absolute path to the destination file. # Generate full, absolute path to the destination file.
fullpath = os.path.abspath(g_outputDir + os.path.sep + filename) fullpath = os.path.abspath(g_outputDir + os.path.sep + filename)
# Unconditionally enable 32-bit paths on Windows.
if g_isWindows:
fullpath = '\\\\?\\' + fullpath.replace("/", "\\")
# Get parent directory path. # Get parent directory path.
dirpath = os.path.dirname(fullpath) dirpath = os.path.dirname(fullpath)
@ -822,6 +826,11 @@ def usbHandleSendFileProperties(cmd_block: bytes) -> int | None:
# Retrieve what we need using global variables. # Retrieve what we need using global variables.
file = g_nspFile file = g_nspFile
fullpath = g_nspFilePath fullpath = g_nspFilePath
# Unconditionally enable 32-bit paths on Windows.
if g_isWindows:
fullpath = '\\\\?\\' + fullpath.replace("/", "\\")
dirpath = os.path.dirname(fullpath) dirpath = os.path.dirname(fullpath)
# Check if we're dealing with an empty file or with the first SendFileProperties command from a NSP. # Check if we're dealing with an empty file or with the first SendFileProperties command from a NSP.