WARN tar EPERM: operation not permitted, futime indicates that
futime syscall (used to change file last access and modification times) fails with error:
utime manpage 1:
EPERM ... the caller's effective UID does not match the owner of the file ...
That seems to be the reason of failure. You are using path:
/data/data/com.termux/files/home/storage/shared/ which is actually
/sdcard/ 2 (symlink to
/storage/emulated/0/). It's not an actual filesystem but an emulated 3 view of underlying filesystem (
f2fs). It has fixed permissions and doesn't support many features of Linux filesystems including symlinks and
Due to fixed permissions all directories and files in
/sdcard/ are always owned by user
0). So while trying to change file's timestamp,
Operation not permitted is returned.
touch command however uses
utimensat 5 which has different permissions requirements.
So to avoid this problem, you should not use emulated filesystem. Termux
$HOME directory is on
f2fs, so it's a good place to save files. Use e.g.
But is it possible to somehow create a link inside
$HOME to another location, which will grant all the rights that Termux has for
$HOME for all the subfolders of this distant location?
No it's not possible on non-rooted phone. Apps can write only to their private directories in internal storage (which is
/data/data/com.termux for Termux) and in shared storage (
/sdcard/Android/data/com.termux). Apps with
Storage permission granted can read and write to whole
/sdcard/. There is no other place on device where apps can save files 6. With SELinux
permissive, it's possible to write to a sub-directory created (with
adb shell) in
/data/local/tmp, but it's not intended use of this directory.
2 How do I access
$HOME/storage outside of Termux (with a file explorer)?
3 What is
4 How can I make a symlink inside
5 How to change the modified date of a file without root?
6 Where Android apps store data?