Wish File.Move

stevel05

Expert
Licensed User
Longtime User
It would only do the same thing, so is there a benefit? You are the programmer, and know the requirements of the OS you are working on.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
You can use this code:
B4X:
Sub FileMove(SourceFolder As String, SourceFile As String, TargetFolder As String, TargetFile As String) As Boolean
   Dim source, target As JavaObject
   source.InitializeNewInstance("java.io.File", Array(SourceFolder, SourceFile))
   target.InitializeNewInstance("java.io.File", Array(TargetFolder, TargetFile))
   Return source.RunMethod("renameTo", Array(target))
End Sub

It returns True if operation was successful.
 
Top