1

On .NET Framework documentation says that when I use FileInfo.OpenRead method a read-only FileStream is created but, which FileShare option is internally used?

Once I've opened the file is read or write locked?

NightOwl888
  • 55,572
  • 24
  • 139
  • 212

2 Answers2

0

A quick look in reference source reveals that it is

FileShare.Read

This setting is documented to

allow[s] subsequent opening of the file for reading

Cee McSharpface
  • 8,493
  • 3
  • 36
  • 77
0

As per the documentation:

This method returns a read-only FileStream object with the FileShare mode set to Read.

mjwills
  • 23,389
  • 6
  • 40
  • 63