The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: limyx826 on May 06, 2024, 05:13:35 AM

Title: r11164 - Can't save "Cannot open target file for writing"
Post by: limyx826 on May 06, 2024, 05:13:35 AM
I think the save menu is missing something.
Screenshot 2024-05-06 011105.png
Title: Re: r11164 - Can't save "Cannot open target file for writing"
Post by: prissi on May 06, 2024, 06:25:21 AM
Seems ok, nothing saved yet.

Or is this a double-byte character 1?

Or I would need more info what you expected to see. Also please state OS, under Windows it was working fine.
Title: Re: r11164 - Can't save "Cannot open target file for writing"
Post by: Andarix on May 06, 2024, 08:22:34 AM
Windows

I had manually installed into a new folder and then set singleuser_install = 1.

I created the save folder before starting. However, not the screenshot folder. I couldn't save screenshots then.

The folder creation probably doesn't work.
Title: Re: r11164 - Can't save "Cannot open target file for writing"
Post by: limyx826 on May 06, 2024, 05:31:01 PM
Quote from: prissi on May 06, 2024, 06:25:21 AMSeems ok, nothing saved yet.

Or is this a double-byte character 1?

Or I would need more info what you expected to see. Also please state OS, under Windows it was working fine.
Well I am using SDL2 64 bit client on Windows 10 22H2 64 bit build 19045.4291 if necessary. The auto save when quit works but manual saving will pop up error message as shown below. No matter which pakset I use it's the same error message.
Screenshot 2024-05-06 132523.pngScreenshot 2024-05-06 132714.png
Title: Re: r11164 - Can't save "Cannot open target file for writing"
Post by: limyx826 on May 06, 2024, 05:50:48 PM
Quote from: Andarix on May 06, 2024, 08:22:34 AMI created the save folder before starting. However, not the screenshot folder. I couldn't save screenshots then.
I also tested screenshot and here's the result.
Screenshot 2024-05-06 135017.png
Title: Re: r11164 - Can't save "Cannot open target file for writing"
Post by: limyx826 on May 06, 2024, 06:01:52 PM
Turns out that the Simutrans user directory is bugged. The Folder creation is not working as mentioned by Andradix, after I manually created save and screenshot folder in ~\Documents\simutrans\ then I can save and screenshot normally. I not sure any features that use user directory that had similar requirements but I assume all of them is bugged in the same matter.
Title: Re: r11164 - Can't save "Cannot open target file for writing"
Post by: ceeac on May 06, 2024, 06:32:45 PM
Quote from: Andarix on May 06, 2024, 08:22:34 AMThe folder creation probably doesn't work.

Yeah, dr_mkdir is likely broken on Windows because SHCreateDirectory returns an error for relative paths
(https://learn.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shcreatedirectory)
Title: Re: r11164 - Can't save "Cannot open target file for writing"
Post by: prissi on May 07, 2024, 05:16:03 AM
Nice, it still return 0 meaning success and not ERROR_BAD_PATHNAME ...

It seems I need to make a new release this weekend with all those errors.