Devv Active Member Licensed User Longtime User Aug 25, 2014 #1 Hi all i'm trying to delete a file from my phone sd card using a shell command Code: Sub Process_Globals Dim p As Phone End Sub Sub Activity_Create(FirstTime As Boolean) p.Shell("rm /sdcard/file1.txt", Null, Null, Null) End Sub i had imported the phone lib 1- when i run my app file1.txt is not deleted any ideas why ? 2- how can i use "file.DirRootExternal" instead of "/sdcard" in the command ? note: i know that i can use file.delete but i want to use shell when i type the same command to terminal emulator the file will be deleted !
Hi all i'm trying to delete a file from my phone sd card using a shell command Code: Sub Process_Globals Dim p As Phone End Sub Sub Activity_Create(FirstTime As Boolean) p.Shell("rm /sdcard/file1.txt", Null, Null, Null) End Sub i had imported the phone lib 1- when i run my app file1.txt is not deleted any ideas why ? 2- how can i use "file.DirRootExternal" instead of "/sdcard" in the command ? note: i know that i can use file.delete but i want to use shell when i type the same command to terminal emulator the file will be deleted !
M Mahares Expert Licensed User Longtime User Aug 26, 2014 #2 Try this. It will delete it for you: Code: p.Shell("rm " & File.Combine(File.DirRootExternal,"file1.txt"), Null, Null, Null) Upvote 0
Try this. It will delete it for you: Code: p.Shell("rm " & File.Combine(File.DirRootExternal,"file1.txt"), Null, Null, Null)
Erel B4X founder Staff member Licensed User Longtime User Aug 26, 2014 #3 If it doesn't work then you should pass the two StringBuilders and check their values. Upvote 0