Skip to content
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

readdlm() doesn't properly close file when file opened with a string #8891

Closed
dahlend opened this issue Nov 3, 2014 · 9 comments
Closed
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@dahlend
Copy link

dahlend commented Nov 3, 2014

A = readdlm("./data.csv")

This will read the file data.csv properly, however it doesn't close the file upon completion.

file_location = file("./data.csv")
A = readdlm(file_location)
close(file_location)

works fine, however I wasn't sure if in the first case was a bug or just poor programming on my part.

@staticfloat
Copy link
Member

Can you post your versioninfo() so that we can see your OS version, your Julia version, etc...

@jakebolewski
Copy link
Member

Are you using Windows?

@dahlend
Copy link
Author

dahlend commented Nov 5, 2014

On a mac, versioninfo() gives, I am reading and writing to a NFS Drive...

Julia Version 0.3.0
Commit 7681878* (2014-08-20 20:43 UTC)

Platform Info:
System: Darwin (x86_64-apple-darwin13.3.0)
CPU: Intel(R) Core(TM) i5-4278U CPU @ 2.60GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
LAPACK: libopenblas
LIBM: libopenlibm
LLVM: libLLVM-3.3

@JeffBezanson
Copy link
Member

Also #4664, but there we did something windows-specific since the consequences are worse there.

@ViralBShah
Copy link
Member

It seems that this is fixed.

@ViralBShah ViralBShah added the bug Indicates an unexpected problem or unintended behavior label May 19, 2015
@ViralBShah ViralBShah added this to the 0.4.0 milestone May 19, 2015
@JeffBezanson
Copy link
Member

I think when we use mmap the file isn't closed until the next GC.

@JeffBezanson JeffBezanson modified the milestones: 0.4.x, 0.4.0 Jun 2, 2015
@tkelman tkelman removed this from the 0.4.x milestone Sep 6, 2016
@felipenoris
Copy link
Contributor

felipenoris commented Oct 7, 2016

Just ran into this today. Your OS is not windows, but I think mmap + NFS causes this.

Use this and it should work.

A = readdlm("./data.csv"; use_mmap=false)

#7007 did put a default use_mmap=false on windows, but this looks like a file-system specific problem. Should we add a comment on the help of readdlm function?

@felipenoris
Copy link
Contributor

... or even put use_mmap=false for every system.

ElOceanografo pushed a commit to ElOceanografo/julia that referenced this issue May 4, 2021
…liaLang#40415)

Increased resilience to edge cases where OS is reported Unix-like but Filesystem is abnormal

Fixes JuliaLang#8891
Fixes JuliaLang#40352
antoine-levitt pushed a commit to antoine-levitt/julia that referenced this issue May 9, 2021
…liaLang#40415)

Increased resilience to edge cases where OS is reported Unix-like but Filesystem is abnormal

Fixes JuliaLang#8891
Fixes JuliaLang#40352
johanmon pushed a commit to johanmon/julia that referenced this issue Jul 5, 2021
…liaLang#40415)

Increased resilience to edge cases where OS is reported Unix-like but Filesystem is abnormal

Fixes JuliaLang#8891
Fixes JuliaLang#40352
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

8 participants