SceneGate / Yarhl

Framework for the implementation of format converters like game assets or media files
https://scenegate.github.io/Yarhl/
MIT License
60 stars 10 forks source link

DataStream.WriteTo does not create the file when the length is zero #136

Closed pleonex closed 3 years ago

pleonex commented 4 years ago

Describe the bug If the user has a DataStream with Length equals to zero, calling to WriteTo(path) will not create an empty file.

To Reproduce Steps to reproduce the behavior:

  1. Create a new empty DataStream
  2. Call to WriteTo(string path)
  3. An empty file is not created in path.

Expected behavior There is an empty file at the given location. The reason is that we use internally a LazyFileStream so it won't call to the FileStream constructor unless a write operation is done.

Additional context We should consider applying the fix to DataStreamFactory.FromFile instead so it behaves like the constructor of FileStream.

github-actions[bot] commented 3 years ago

:tada: This issue has been resolved in version v3.1.0 :tada:

The release is available on: