-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Too many open files #352
Comments
Not for me. Can you provide a fully-reproducible example? Something that runs if you just copy/paste it in the REPL. I can handle the directory-creation, don't worry about that part. |
Sorry for the confusion. I thought the bug was common. But it may only be triggered by a specific type, I guess. using FileIO
using Luxor
function randpic(size=32)
d = Drawing(size, size, :image)
origin()
background(1,1,1)
setcolor(1,0,0)
circle(Point(0, 0), size÷2; action=:fill)
mat = image_as_matrix()
finish()
mat
end
pic = randpic();
@show typeof(pic)
mkdir("datasets2")
for i in 1:20000
save("datasets2/$i.png", pic)
end
My environment: Julia Version 1.7.0-rc2 Status |
ImageMagick has largely been supplanted by ImageIO. I also thought I'd see what you thought about avoiding being "opinionated" about which specific IO packages are best, so I moved such dependencies to [extras]. But we could move such dependencies back to [deps] if you're worried about providing an out-of-box experience that "just works" without the user having to choose specific IO package(s). xrefs: - JuliaIO/PNGFiles.jl#45 - JuliaIO/FileIO.jl#352
Is there anything can be done in FileIO.jl? After all the manual open-save-close form works fine. I don't know FileIO's mechanism, but as a user I hope the framework will force close everything it opened. Thank you. |
So FileIO doesn't handle the opening/closing. |
ImageMagick has largely been supplanted by ImageIO. I also thought I'd see what you thought about avoiding being "opinionated" about which specific IO packages are best, so I moved such dependencies to [extras]. But we could move such dependencies back to [deps] if you're worried about providing an out-of-box experience that "just works" without the user having to choose specific IO package(s). xrefs: - JuliaIO/PNGFiles.jl#45 - JuliaIO/FileIO.jl#352
Fixes JuliaIO/FileIO.jl#352 Co-authored-by: Drvi <[email protected]>
ImageMagick has largely been supplanted by ImageIO. I also thought I'd see what you thought about avoiding being "opinionated" about which specific IO packages are best, so I moved such dependencies to [extras]. But we could move such dependencies back to [deps] if you're worried about providing an out-of-box experience that "just works" without the user having to choose specific IO package(s). xrefs: - JuliaIO/PNGFiles.jl#45 - JuliaIO/FileIO.jl#352
Function
save
seems failed to close files automatically.The code
runs fine. However the code
leads to
The text was updated successfully, but these errors were encountered: