5 ms·
> However, the new “more secure” Universal Windows Platform (UWP) sandboxes the file picker in a separate process, allowing neat features like capability-based
by cesarb 4y ago
> However, the new “more secure” Universal Windows Platform (UWP) sandboxes the file picker in a separate process, allowing neat features like capability-based access control. It returns a file handle which, if the selected file exists, will not overwrite the existing content!
That got me a bit worried, since desktop Linux is going somewhat in the same direction with sandboxed applications. So I did a quick search for the file chooser portal API, and if I understood what I found correctly (https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.FileChooser https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.free... and https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.Documents https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.free...), it does not return an already opened file handle; instead, the file is made available in a FUSE mountpoint within the sandbox (/run/user/$UID/doc/), and the call returns a URI pointing to that file. So, if I understood it correctly, developers can keep using the same traditional POSIX APIs they're already used to, with the same semantics they always had outside the sandbox.
- kirbyfan64sos 4y agoIndeed, 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/document-portal/document-portal-fuse.c#L2636 https://github.com/flatpak/xdg-desktop-portal/blob/main/docu...), so it should be possible to avoid this scenario altogether.
- asveikau 4y agoBasically what Microsoft has been doing since Windows 8 in 2012 is the equivalent of deprecating open(2). The people writing the new APIs have no idea how to design them, they think something like having a flag to overwrite the existing file is useless, confusing, legacy cruft. I doubt people working in the Linux space would be so brazen.
- bacchusracine 4y ago>I doubt people working in the Linux space would be so brazen. Have you heard about this little project called Gnome yet?
- asveikau 4y agoI haven't used gnome on my own machines since the late 90s, or on machines that aren't mine since the mid 2000s, so I dunno. I really doubt they'd try to literally destroy open(2). Sandboxing is different from this.
- hawski 4y agoWould receiving an fd via Unix socket be better or worse idea? Then the returned path could be /dev/fd/XXX
- zokier 4y agoConceptually fd would be more elegant and better overall, but passing a path is probably easier to interoperate with all the libraries etc that are out there
- nwah1 4y agoUWP is deprecated. WinUI version 3 is now recommended. At least with the .NET API, file saving now works like a normal Win32 app from a programmer's perspective. Not sure if it is different under the hood.
- Dalewyn 4y ago>UWP is deprecated. Win32: "Once more, yet another challenger falls before me. Who's next?"
- Arrath 4y agoSounds like a ripe opportunity to do a parody cover of Tenacious D's The Metal.
- meepmorp 4y agoWin32 evolved fill a certain ecological niche millions of years ago, and it's only going away if that niche does or if something manages to fill it better.
- hulitu 4y agoHave you seen the "save screen" in win 10 ? It makes insects look beautiful in comparison.
- therein 4y ago> UWP is deprecated That new shiny thing that Microsoft always pushed on me back when I was using .NET Framework 2.0 with C# is now deprecated before I gave it a try.