abedijoo / excellibrary

Automatically exported from code.google.com/p/excellibrary
0 stars 0 forks source link

Requesting Read Only Mode #42

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Make a xls file read only
2. Call Load on file

What is the expected output? What do you see instead?
Allow reads from xls file. Exception was thrown, access denied to file

What version of the product are you using? On what operating system?
Latest. XP

Please provide any additional information below.

Original issue reported on code.google.com by shallowm...@gmail.com on 14 Aug 2009 at 12:23

GoogleCodeExporter commented 8 years ago
Issue 138 has been merged into this issue.

Original comment by jetcat on 1 Mar 2013 at 11:02

GoogleCodeExporter commented 8 years ago
this is a total hack, but gets the job done.  can be cleaned up a bit, not that 
hard.

Original comment by spot...@gmail.com on 12 Jun 2013 at 8:58

Attachments:

GoogleCodeExporter commented 8 years ago
above patch isn't perfect, but the main idea is

- FileStream stream = File.Open(file, FileMode.Open, FileAccess.ReadWrite, 
FileShare.Read);

vs

+ FileStream stream = File.Open(file, FileMode.Open, FileAccess.Read, 
FileShare.ReadWrite);

i.e. open read only and file share needs to be readwrite (as excel has it open 
read/write and fileshare looks at previously opens as well)

Original comment by spot...@gmail.com on 12 Jun 2013 at 9:01

GoogleCodeExporter commented 8 years ago
slight fix to the diff, to remove a bad change that wasn't fixed and make it be 
totally orthogonal to original code.

Original comment by spot...@gmail.com on 12 Jun 2013 at 9:03

Attachments: