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

FileAccess.Read & FileShare.Read #248

Closed
iamwyza opened this issue Jun 10, 2017 · 3 comments
Closed

FileAccess.Read & FileShare.Read #248

iamwyza opened this issue Jun 10, 2017 · 3 comments

Comments

@iamwyza
Copy link

iamwyza commented Jun 10, 2017

Any chance to have the option to tell FileHelpers engines to try to open a file with FileShare.Read and FileAccess.Read set? Currently if the file is open by something else (say Excel) FH will fail because Excel locks the file. It'd be nice to have the option of saying that we want to load the file even if it is locked (assuming whatever is locking it has set the appropriate sharing levels on its side).

Thanks

@iamwyza
Copy link
Author

iamwyza commented Jun 10, 2017

Edit: Changed FileShare.Read to FileShare.ReadWrite. Excel appears to open files with Share level of ReadWrite, so Read fails.

@MarcosMeli
Copy link
Owner

MarcosMeli commented Jun 10, 2017 via email

@iamwyza
Copy link
Author

iamwyza commented Jun 10, 2017

Oh, so you can. Have been using the BeginReadFile method, didn't notice the BeginReadStream method. Excellent. Thanks!

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

2 participants