mirror of
https://github.com/beefytech/Beef.git
synced 2025-07-03 06:45:59 +02:00
Change to allow working in installer
This commit is contained in:
parent
5c813f31ec
commit
463e26ff75
19 changed files with 571 additions and 57 deletions
|
@ -11,6 +11,10 @@ namespace System.IO
|
|||
|
||||
public bool AutoFlush;
|
||||
|
||||
public this()
|
||||
{
|
||||
}
|
||||
|
||||
public this(Stream stream, Encoding encoding, int32 bufferSize, bool ownsStream = false)
|
||||
{
|
||||
Debug.Assert(encoding != null);
|
||||
|
@ -19,6 +23,21 @@ namespace System.IO
|
|||
mOwnsStream = ownsStream;
|
||||
}
|
||||
|
||||
public Result<void, FileOpenError> Create(StringView fileName)
|
||||
{
|
||||
Debug.Assert(mStream == null);
|
||||
|
||||
var fileStream = new FileStream();
|
||||
mStream = fileStream;
|
||||
mEncoding = .UTF8;
|
||||
mOwnsStream = true;
|
||||
|
||||
if (fileStream.Open(fileName, FileMode.Create, FileAccess.Write, FileShare.ReadWrite) case .Err(let err))
|
||||
return .Err(err);
|
||||
|
||||
return .Ok;
|
||||
}
|
||||
|
||||
public Result<void> Write(Span<uint8> data)
|
||||
{
|
||||
var spanLeft = data;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue