2 ms·
>it's designed for POSIX-likes first which is why one has to pass 0666 or whatever as permissions when trying to open a file on Windows <Snicker> Well. That's
by salawat 4y ago
>it's designed for POSIX-likes first which is why one has to pass 0666 or whatever as permissions when trying to open a file on Windows
<Snicker>
Well. That's amusing. So everytime one does file access through Go on a windows machine, one invokes the number of the Beast, eh?
Apropos af if true. Also hilarious if it just by chance worked out that way.
- Joker_vD 4y agoWell, as I said, you can pass pretty much whatever, none of those bits (except the owner-writeable bit) do anything because Windows uses a fundamentally different model of access control. And no, Golang's os.Create() passes 0666 to os.OpenFile [0], just as fopen(3) passes 0666 to creat(2) [1] on Linux as well. [0] https://cs.opensource.google/go/go/+/refs/tags/go1.19:src/os/file.go;drc=b72a6a7b868deb5b671020c08fbf8d61ad8803d4;l=326 https://cs.opensource.google/go/go/+/refs/tags/go1.19:src/os... [1] https://linux.die.net/man/3/fopen https://linux.die.net/man/3/fopen