Closed a-chen closed 9 months ago
Seems to be a Windows thing where Windows recognizes "someDirectory " to be the exact same as "someDirectory" https://stackoverflow.com/questions/74936903/why-do-some-os-functions-ignore-trailing-spaces-on-windows
Oh dear jezus ;_;
i will try to handle this in some time - maybe a week or smth
big thanks for figuring this out by the way...
Hi man! Looked into this finally, and here is my try: https://github.com/TheLastGimbus/GooglePhotosTakeoutHelper/commit/7e7216d9ef7723bc31b237c1c3b3f0b72e75f77b
here is the nightly exe: https://github.com/TheLastGimbus/GooglePhotosTakeoutHelper/actions/runs/5271626192
let me know if it works now :+1:
Hi, ran into an issue caused by a trailing space somehow showing up at the end of one of my directories in the example below. The exception caused the program to exit.
Being lazy, I asked ChatGPT where to make the change in
moving.dart
"I encountered an error that seems to be caused by a space at the end of the folder name in the below error. I think the solution would be to strip leading and trailing empty characters of file and folder names. Where should this change be made?"
and it recommended the following changes. Looked mostly correct to me, so am reporting this issue. Hope this helps! Greatly appreciate your work
ChatGPT response
The change should be made where the file and folder paths are being constructed, specifically where the folder's name is defined and where the file is being moved or copied to.
Here is where you can make the changes:
Line 83-90: This is where the folder path is constructed. You can use Dart's trim method to remove leading and trailing white spaces from the file and folder names. Replace the existing lines with the following code:
Line 107-110: This is where the file is being moved or copied. Again, you should trim the filename here:
After these changes, your program should work correctly with folder or file names that have leading or trailing spaces.