[Problem] Bug when folder ends with a space #853

Closed
opened 2026-01-29 16:23:21 +00:00 by claunia · 1 comment
Owner

Originally created by @FoxhackDN on GitHub (Jul 14, 2025).

Originally assigned to: @mnadareski on GitHub.

Version
What version are you using?

  • Stable release 3.3.2
  • WIP release (version here)

Build
What runtime version are you using?

  • .NET 9.0 running on (Operating System)

Describe the issue
If the middle of the folder path written in "Output Path" in MPF has a space at the end, the dump will not begin and MPF will say it failed to find any files.

To Reproduce
Steps to reproduce the behavior:

  1. Insert a disc, select platform as normal.
  2. In Output Path, the default is always ISO\Dump Name\dumpfile.bin
  3. Add a space at the end of the folder name, so the path is now ISO\Dump Name \dumpfile.bin
  4. Dump fails.

Expected behavior
Ideally the program would either trim the space, prevent you from starting a dump, warn you about it, or yell at you for using it.

Additional context

Other tests:
ISO\Dump Name\Second Folder\dumpfile.bin will work
ISO\Dump Name \Second Folder\dumpfile.bin will fail
ISO\Dump Name\Second Folder \dumpfile.bin will fail

ISO \Dump Name\dumpfile.bin will create a second ISO folder in the MPF directory and it points to the same location as your old dump files so PLEASE DO NOT DO THAT

Originally created by @FoxhackDN on GitHub (Jul 14, 2025). Originally assigned to: @mnadareski on GitHub. **Version** What version are you using? - [X] Stable release 3.3.2 - [ ] WIP release (version here) **Build** What runtime version are you using? - [X] .NET 9.0 running on (Operating System) **Describe the issue** If the middle of the folder path written in "Output Path" in MPF has a space at the end, the dump will not begin and MPF will say it failed to find any files. **To Reproduce** Steps to reproduce the behavior: 1. Insert a disc, select platform as normal. 2. In Output Path, the default is always `ISO\Dump Name\dumpfile.bin` 3. Add a space at the end of the folder name, so the path is now `ISO\Dump Name \dumpfile.bin` 4. Dump fails. **Expected behavior** Ideally the program would either trim the space, prevent you from starting a dump, warn you about it, or yell at you for using it. **Additional context** Other tests: `ISO\Dump Name\Second Folder\dumpfile.bin` will work `ISO\Dump Name \Second Folder\dumpfile.bin` will fail `ISO\Dump Name\Second Folder \dumpfile.bin` will fail `ISO \Dump Name\dumpfile.bin` will create a second ISO folder in the MPF directory and it points to the same location as your old dump files so PLEASE DO NOT DO THAT
claunia added the bug label 2026-01-29 16:23:21 +00:00
Author
Owner

@mnadareski commented on GitHub (Jul 14, 2025):

There's a combination of things at work here:

  • The first failure case is likely a Windows-specific issue in how it handles spaces at the start and end of directory and file paths. That means that all instances where there's a space immediately before or after the directory separator needs to be trimmed and resaved during normalization.
  • The second is more easily explained, since the "root path" that's retrieved has the value trimmed, leaving it to try to find files in a place where it really isn't. This would also be fixed during normalization, but as a result of entirely different reasons. This one would affect all supported OSes.
@mnadareski commented on GitHub (Jul 14, 2025): There's a combination of things at work here: - The first failure case is likely a Windows-specific issue in how it handles spaces at the start and end of directory and file paths. That means that all instances where there's a space immediately before or after the directory separator needs to be trimmed and resaved during normalization. - The second is more easily explained, since the "root path" that's retrieved has the value trimmed, leaving it to try to find files in a place where it really isn't. This would also be fixed during normalization, but as a result of entirely different reasons. This one would affect all supported OSes.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SabreTools/MPF#853