VFileStream Constructor
Namespace: Rebex.IO
Assembly: Rebex.FileSystem.dll (version 7.0.9119)
VFileStream(String, FileMode, FileAccess, FileShare, Int32, Boolean)
Initializes a new instance of the VFileStream
for a file identified by the path
, required mode
and requested access
.
A caller must dispose the returned stream.
Arguments share, bufferSize and useAsync are not used.
Declaration
public VFileStream(string path, FileMode mode, FileAccess access, FileShare share, int bufferSize, bool useAsync)
Parameters
Type | Name | Description |
---|---|---|
String | path | The path of the file. |
FileMode | mode | One of the FileMode values which determines how to open a file. |
FileAccess | access | One of the FileAccess values which determines if the returned stream should be read-only stream, write-only stream or read/write stream. |
FileShare | share | This argument is ignored. Concurrent access to the same virtual file is not supported and leads to undefined behavior. |
Int32 | bufferSize | This argument is ignored. |
Boolean | useAsync | This argument is ignored. Rebex virtual file systems now supports only synchronous methods. |
Remarks
Concurrent access to the same virtual file is not supported and leads to undefined behavior.
Examples
//Create a built-in or custom VFS provider
var memoryProvider = new MemoryFileSystemProvider()
//Save the root path
var memoryProviderRootPath = memoryProvider.GetRootVDirectoryInfo().FullName;
//Create 'file.dat' file in the root directory and open VFileStream for writing.
using (var myFileStream = new VFileStream(Path.Combine(memoryProviderRootPath, "file.dat"), FileMode.CreateNew, FileAccess.Write))
{
myFileStream.Write(myData, 0, myData.Length);
}
VFileStream(String, FileMode, FileAccess, FileShare, Int32)
Initializes a new instance of the VFileStream
for a file identified by the path
, required mode
and requested access
.
A caller must dispose the returned stream.
Arguments share and bufferSize are not used.
Declaration
public VFileStream(string path, FileMode mode, FileAccess access, FileShare share, int bufferSize)
Parameters
Type | Name | Description |
---|---|---|
String | path | The path of the file. |
FileMode | mode | One of the FileMode values which determines how to open a file. |
FileAccess | access | One of the FileAccess values which determines if the returned stream should be read-only stream, write-only stream or read/write stream. |
FileShare | share | This argument is ignored. Concurrent access to the same virtual file is not supported and leads to undefined behavior. |
Int32 | bufferSize | This argument is ignored. |
Remarks
Concurrent access to the same virtual file is not supported and leads to undefined behavior.
VFileStream(String, FileMode, FileAccess, FileShare)
Initializes a new instance of the VFileStream
for a file identified by the path
, required mode
and requested access
.
A caller must dispose the returned stream.
Argument share is not used.
Declaration
public VFileStream(string path, FileMode mode, FileAccess access, FileShare share)
Parameters
Type | Name | Description |
---|---|---|
String | path | The path of the file. |
FileMode | mode | One of the FileMode values which determines how to open a file. |
FileAccess | access | One of the FileAccess values which determines if the returned stream should be read-only stream, write-only stream or read/write stream. |
FileShare | share | This argument is ignored. Concurrent access to the same virtual file is not supported and leads to undefined behavior. |
Remarks
Concurrent access to the same virtual file is not supported and leads to undefined behavior.
VFileStream(String, FileMode, FileAccess, FileShare, Int32, FileOptions)
Initializes a new instance of the VFileStream
for a file identified by the path
, required mode
and requested access
.
A caller must dispose the returned stream.
Arguments share, bufferSize are not used.
Declaration
public VFileStream(string path, FileMode mode, FileAccess access, FileShare share, int bufferSize, FileOptions options)
Parameters
Type | Name | Description |
---|---|---|
String | path | The path of the file. |
FileMode | mode | One of the FileMode values which determines how to open a file. |
FileAccess | access | One of the FileAccess values which determines if the returned stream should be read-only stream, write-only stream or read/write stream. |
FileShare | share | This argument is ignored. Concurrent access to the same virtual file is not supported and leads to undefined behavior. |
Int32 | bufferSize | This argument is ignored. |
FileOptions | options | Only DeleteOnClose option is supported. All other options are ignored. |
Remarks
Concurrent access to the same virtual file is not supported and leads to undefined behavior.
VFileStream(String, FileMode)
Initializes a new instance of the VFileStream
for a file identified by the path
, required mode
and with ReadWrite access.
A caller must dispose the returned stream.
Declaration
public VFileStream(string path, FileMode mode)
Parameters
Type | Name | Description |
---|---|---|
String | path | The path of the file. |
FileMode | mode | One of the FileMode values which determines how to open a file. |
VFileStream(String, FileMode, FileAccess)
Initializes a new instance of the VFileStream
for a file identified by the path
, required mode
and requested access
.
A caller must dispose the returned stream.
Arguments share and bufferSize are not used.
Declaration
public VFileStream(string path, FileMode mode, FileAccess access)
Parameters
Type | Name | Description |
---|---|---|
String | path | The path of the file. |
FileMode | mode | One of the FileMode values which determines how to open a file. |
FileAccess | access | One of the FileAccess values which determines if the returned stream should be read-only stream, write-only stream or read/write stream. |