Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
Indeed, and the document portal seems to have built-in support for atomic writes by first writing to a temporary file and then renaming it (https://github.com/flatpak/xdg-desktop-portal/blob/main/docu...), so it should be possible to avoid this scenario altogether.
>The documentation for FileSavePicker doesn’t mention the problem or truncate files in the example code. It is no surprise that the default behaviour of not truncating existing files is, therefore commonplace, despite being not what most people want. 5/9
The documentation: https://learn.microsoft.com/en-us/uwp/api/windows.storage.pi...
>The file name, extension, and location of this storageFile match those specified by the user, but the file has no content.
(Emphasis mine.)
And it's not a recent change. It was written in 2017. https://github.com/MicrosoftDocs/winrt-api/blame/docs/window...
So it may just be a bug, hopefully recently introduced.