Skip to content

Conversation

@RandomShaper
Copy link
Member

@RandomShaper RandomShaper commented Nov 7, 2024

This raises the number to the maximum value according to the docs, which is 8192. The default is 512.

This should avoid many file access errors that happen in big projects during heavy operations dealing with many resources.

A better fix woul be to rewrite FileAccessWindows so it uses the Win32 API directly. However, this already brings value.

I think both MSVC and MinGW support this. MSVC does for sure. Let's see what CI thinks about MinGW.

@RandomShaper RandomShaper added enhancement platform:windows cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release labels Nov 7, 2024
@RandomShaper RandomShaper added this to the 4.4 milestone Nov 7, 2024
@RandomShaper RandomShaper requested a review from a team as a code owner November 7, 2024 11:16
Copy link
Member

@fire fire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Raising the limit is a win, assuming the change doesn't break anything.

@AThousandShips AThousandShips changed the title Raise the amount of file handles on Windows Raise the number of file handles on Windows Nov 8, 2024
@akien-mga akien-mga requested a review from bruvzg November 29, 2024 14:50
Copy link
Member

@bruvzg bruvzg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think both MSVC and MinGW support this.

MinGW implementation seems to be dummy, so relevant only for MSVC. But should not break anything.

https://github.com/mingw-w64/mingw-w64/blob/master/mingw-w64-crt/stdio/_setmaxstdio.c

A better fix woul be to rewrite FileAccessWindows so it uses the Win32 API directly. However, this already brings value.

This is likely a better option.

@akien-mga akien-mga merged commit c2f19e9 into godotengine:master Nov 29, 2024
20 checks passed
@akien-mga
Copy link
Member

Thanks!

@RandomShaper RandomShaper deleted the win_many_files branch December 3, 2024 05:56
TML233 added a commit to TML233/godot that referenced this pull request Dec 16, 2024
@AThousandShips AThousandShips removed the cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release label Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants