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

OpenFileForReading should perform Read-only access on file #9

Open
leonbloy opened this issue Jan 7, 2015 · 1 comment
Open

OpenFileForReading should perform Read-only access on file #9

leonbloy opened this issue Jan 7, 2015 · 1 comment

Comments

@leonbloy
Copy link
Owner

leonbloy commented Jan 7, 2015

From [email protected] on November 09, 2013 07:39:10

By view point of parallelism, sometimes we access .png files by multiple threads simultaneously. Current pngcs implementation prevents things from working properly because OpenFileForReading method in FileHelper performs Read/Write (calling FileStream(String, FileMode) constructor without passing third argument; FileAccess, result in R/W access) and perform locks on files.

So, I propose applying the following patch on FileHelper.cs

  •        isx = new FileStream(file, FileMode.Open);
    
  •        isx = new FileStream(file, FileMode.Open, FileAccess.Read);
    

Original issue: http://code.google.com/p/pngcs/issues/detail?id=9

@leonbloy
Copy link
Owner Author

leonbloy commented Jan 7, 2015

From [email protected] on November 09, 2013 02:45:04

Just forgot to note. Please refer to http://msdn.microsoft.com/en-us/library/47ek66wy(v=vs.110).aspx for more detail about FileStream constructor behaviour.

kekekeks added a commit to kekekeks/pngcs that referenced this issue Nov 26, 2018
support portable.xaml markupextensions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant