Xavier de Gaye added the comment: > Why os.link() is failed? If hard links are not supported on Android, > shouldn't os.link be not implemented?
Android has a restrictive security model based on SELinux [1]. With the Android adb shell on the emulator at API level 24: $ >foo $ ln foo bar ln: cannot create hard link from 'foo' to 'bar': Permission denied $ su # ln foo bar # ls -li foo bar 15688 -rw-rw-rw- 2 shell shell 0 2017-01-07 22:29 bar 15688 -rw-rw-rw- 2 shell shell 0 2017-01-07 22:29 foo Here is the Android commit message that does not grant hard link capabilities by default: https://android.googlesource.com/platform/external/sepolicy/+/85ce2c7 [1] https://source.android.com/security/selinux/ ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29181> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com