Demonstrate an odd effect that holding onto a file handle can still allow you to edit the contents, of that file even after its permissions have been changed, despite even invoking .Sync() or *flush()
- Linux 4.15.0-147-generic #151-Ubuntu SMP
- Darwin 19.6.0 root:xnu-6153.141.2~1/RELEASE_X86_64 x86_64
$ gcc -o demo demo.c && ./demo
Unfortunately mismatched content
Got: abcdefghijkl
Want: abcdef
$ go run demo.go
Unfortunately mismatched content
Got: abcdefghijkl
Want: abcdef
exit status 1
$ python3 demo.py
Unfortunately mismatched content
Got: abcdefghijkl
Want: abcdef