coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

Sort: Fixing opens too many files

Open allaboutevemirolive opened this issue 1 year ago • 2 comments

Issue #5714 is addressed in this pull request.

Reference:

The same problem can be found in:

To be honest, I am not sure what the exact solution is to this problem. Increasing ulimit, for example, can resolve this issue, as can removing the -m flag from sort -n -m.

This pull request currently requires the user to run the target bash script in sudo mode. Hopefully, the maintainers can incorporate some hints into this PR.:)

allaboutevemirolive avatar Dec 28 '23 08:12 allaboutevemirolive

sorry but i don't think it is the right approach. Instead, we should investigate where we need to open temporary files and replace it by in memory (or something else) operation

sylvestre avatar Dec 28 '23 09:12 sylvestre

Thank you for your feedback. I'll look at ways to fix the issues without changing system resource limits.

Edit: I think digging into cp.rs can give me some hints, and yes, we need to open temporary files and replace them in memory.

Edit: I have an exam coming up in the first month of 2024. Please feel free to create a new PR and close this one. If no new PR is issued, I will investigate this matter in my spare time. :)

allaboutevemirolive avatar Dec 28 '23 09:12 allaboutevemirolive