![]() ![]() | ||
When you open a file, you can specify the file-sharing mode you want to use in some of the FileStream constructors (you don't have to specify a file-sharing mode with other FileStream constructors). For example, if you want to allow other programs to read a file at the same time you're working with it, you use the file-sharing mode FileShare.Read. The various possible file-sharing modes are part of the FileShare enumeration, and you can find the members of this enumeration in Table 13.11.
Member |
Means |
---|---|
None |
The file cannot be shared. Other processes cannot access it. |
Read |
The file also may be opened by other processes for reading. |
ReadWrite |
The file also may be opened by other processes for reading and writing. |
Write |
The file also may be opened by other processes for writing. |
![]() ![]() | ||