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

Request: Make checkAccess() more robust, by checking read access using the same method as in the R.utils package #267

Open
bschneidr opened this issue Sep 4, 2024 · 0 comments

Comments

@bschneidr
Copy link

bschneidr commented Sep 4, 2024

Summary

The checkAccess() function currently fails to correctly check read access for files on a network drive, because it relies on the base R function file.access(), which has long had issues correctly checking read access for files on network drives.

This proposal is to update checkAccess() to add a backup option when file.access() indicates that a file is unreadable. The method for doing this is copied from the R.utils package's function, named fileAccess(), which was developed in part to deal with this problem with network drives.

I'm making a small pull request that implements this proposal.

Background

Unfortunately, many organizations with network drives have policies that require all data files to be stored on a network drive, so just copying files to a local folder isn't a workaround for such users. This comes up at the company I work for and at the federal agency clients I work for.

For some background, here are a couple references on the issue with base file.access():

@HenrikBengtsson implemented a more robust version of file.access() in the "R.utils" package.

It works by first trying to use file.access(), and then--if the file appears unreadable based on that--then attempts a small read of the file and checks whether that read was successful.

It would be very helpful if checkmate adopted this same approach. But rather than add 'R.utils' as a dependency, 'checkmate' can simply re-use some code, with attribution.

bschneidr pushed a commit to bschneidr/checkmate that referenced this issue Sep 4, 2024
bschneidr pushed a commit to bschneidr/checkmate that referenced this issue Sep 4, 2024
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