mirror of
https://github.com/beefytech/Beef.git
synced 2025-07-04 15:26:00 +02:00
Merge pull request #1130 from disarray2077/fix_ide_textwrites
Fix issues with the methods for writing files
This commit is contained in:
commit
3cd94cbc8e
11 changed files with 142 additions and 63 deletions
|
@ -295,11 +295,13 @@ namespace Beefy
|
|||
|
||||
public static Result<void> WriteTextFile(StringView path, StringView text)
|
||||
{
|
||||
var stream = scope FileStream();
|
||||
if (stream.Create(path) case .Err)
|
||||
{
|
||||
var stream = scope UnbufferedFileStream();
|
||||
if (stream.Open(path, .OpenOrCreate, .Write) case .Err)
|
||||
return .Err;
|
||||
}
|
||||
|
||||
if (stream.SetLength(text.Length) case .Err)
|
||||
return .Err;
|
||||
|
||||
if (stream.WriteStrUnsized(text) case .Err)
|
||||
return .Err;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue