This was a wonderful and very useful sub posted by Margret (110653). Thank you, Margret.
The sub works GREAT! The question is what is the "mv " app that is the target of the Shell?
The sub works GREAT! The question is what is the "mv " app that is the target of the Shell?
The desolatesoul was kind enough to send me the core code of which I created this sub. I have tested it with files up to 1.5gig. You must pass the full path and file name for the original and the new file. It returns True if the file was renamed and False if it was not.
Uses the Phone library
Call with:
B4X:RenameFile("/mnt/sdcard/Movies/Monsters_HQ.mp4", "/mnt/sdcard/Movies/M_HQ.mp4")
B4X:Sub RenameFile(OriginalFileName As String, NewFileName As String) As Boolean Dim Result As Int Dim StdOut, StdErr As StringBuilder StdOut.Initialize StdErr.Initialize Dim Ph As Phone Result = Ph.Shell("mv " & OriginalFileName & " " & NewFileName, Null, StdOut, StdErr) If Result = 0 Then Return True Else Return False End If End Sub
Margret![]()