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

h5testFileLocking false negatives - fails in a directory without permissions #77

Open
LTLA opened this issue Dec 18, 2020 · 0 comments
Open

Comments

@LTLA
Copy link
Contributor

LTLA commented Dec 18, 2020

dir.create("things")

library(rhdf5)
B = array(seq(0.1,2.0,by=0.1),dim=c(5,2,2))
attr(B, "scale") <- "liter"
h5write(B, "things/stuff.h5","B")

Sys.chmod(paths="things/", mode="544")

# Everything works fine with file locking
h5ls("things/stuff.h5")
h5read("things/stuff.h5", "B") 

# But yet...
h5testFileLocking("things/")
## [1] FALSE
## Warning message:
## In file.remove(file) :
##   cannot remove file 'things//filed7661b820f0d', reason 'No such file or directory'

The most obvious problem is that there is an extraneous warning when the file cannot be created. The less obvious problem is that file locking still seems to work when we don't have write access to the file, in which case rhdf5's check is not quite correct. Perhaps a better solution would be to test the file locking capability on a file-by-file basis prior to read operations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant