Open ghost opened 2 years ago
That is definitely a Termux bug. You also can't delete a folder with files in it from the file explorer. This line is likely responsible for it. The delete method only works for empty directories. Implementing a recursive delete for directories should fix it.
For renaming and moving the Android storage framework has special methods which are just not implemented in Termux. There is already a pull request for that.
That is definitely a Termux bug. You also can't delete a folder with files in it from the file explorer. This line is likely responsible for it. The delete method only works for empty directories. Implementing a recursive delete for directories should fix it.
For renaming and moving the Android storage framework has special methods which are just not implemented in Termux. There is already a pull request for that.
So why not the PR is getting merged? I can see there is no problem merging it.
So why not the PR is getting merged?
I didn't get time to look into SAF to merge it. Moreover, the termux-shared
library provides FileUtils
, which are more reliable and safe to use than directly using File
API like "normally" done, like done in PR, specially for symlinks. So such functions should ideally be re-written with FileUtils
functions. I'll try taking time to do that, if someone else doesn't.
@Hax4us is this issue solved? If solved then when I'll get the Termux release with this fix?
The pull request #2538 is already open for it. You can grab github actions builds at https://github.com/termux/termux-app/actions/runs/1728733273. Should be available in next release whenever that happens, assuming pull request is approved and merged.
Any progress on this?
Problem description
I use the Acode app to edit files on Termux. If I try to delete a non-empty Termux directory using Acode app, then it shows a FileNotFoundException error. However, if the directory is empty, or is a file, then it can be deleted without any error. However, I can never rename or cut any file or directory in Termux using the Acode app, doing so shows the same error. The bug is not in Acode app, but maybe in Termux (or maybe a restriction in the Android framework?). I can manipulate (delete/cut/paste) any file or directory in the device internal storage without any single error from Acode app. I also tried with other code editors (like QuickEdit), and the same happens.
Steps to reproduce the behavior.
Suppose, I have a folder named Projects in the home directory. Projects folder contains many other folders and files in it: ~/
Now if I try to delete (or rename or cut or copy) the Projects folder:
It shows error:
What is the expected behavior?
I should be able to rename, cut, copy, paste any file or directory in Termux from any outside app.
System information