termux / termux-app

Termux - a terminal emulator application for Android OS extendible by variety of packages.
https://f-droid.org/en/packages/com.termux
Other
35.34k stars 3.72k forks source link

Is it possible to make work symlinks on mounted internal storage? #513

Closed imShara closed 5 years ago

imShara commented 6 years ago

I want to make my project directory accessible from termux and other android application (e.g Syncthing). I made symlink from storage to termux home ln -s ~/storage/shared/Projects/MyProject ~/MyProject. It works until I need to make symlink in my project directory (e.g nodejs npm module requires it).

cd ~/MyProject
ln -s test.txt test2.txt
ln: test2.txt: Operation not permitted

Android disallows symlinks in /storage/emulated, but can termux workaround this?

ghost commented 6 years ago

Android disallows symlinks in /storage/emulated, but can termux workaround this?

There only one workaround - put your files into Termux home ($HOME), this is limitation of Android.

apolbox commented 6 years ago

is my problem too. i want to create symlink myproject to default-site Apache.

for editing with application Our code editor not editor from termux, ex: micro, nano.

eliaspizarro commented 6 years ago

Maybe can be done with similar termux-setup-storage script method?

ghost commented 6 years ago

Maybe can be done with similar termux-setup-storage script method?

Symlinks are not possible under /storage/emulated/0. It is not possible to use features that is not implemented in FS.

If you want symlinks - do this on EXT4 or F2FS file system which is typically /data partition, i.e. $HOME.

termux-setup-storage works in $HOME, so symlinks are possible here.


Note: /storage/emulated/0 is still placed on EXT4, but due to FAT32 emulation via sdcardfs or similar forget about using symlinks here. You cannot bypass Android restrictions without root. You cannot use features that not exist or not implemented.

Quasic commented 6 years ago

Some other systems have the same problem. There are sometimes ways around this, such as in nodejs code, making a file that includes the target. If the file is static, and not too large, it is often simply copied.

ghost commented 5 years ago

Closing because of https://github.com/termux/termux-app/issues/513#issuecomment-425093840.

v943 commented 4 years ago

is my problem too. i want to create symlink myproject to default-site Apache.

for editing with application Our code editor not editor from termux, ex: micro, nano.

just change the default-site to your project edit httpd.conf: /data/data/com.termux/files/usr/etc/apache2/httpd.conf

edit the DocumentRoot option: DocumentRoot /path/to/your/project