2011-10-18 16 views
0

私はSDカードで作成したディレクトリの名前を変更したいので、Fileオブジェクト(File.Renameなど)を使って簡単に行うことができると考えました。しかし、私は簡単なことは何も見ません。すべてのディレクトリ構造を新しい名前の新しいディレクトリにコピーし、古いディレクトリのすべてのファイルを削除してから、古いディレクトリを削除する必要がありますか?それとも私が知らない簡単な方法はありますか?Basic4Androidでディレクトリの名前を変更する簡単な方法はありますか?

答えて

1

あなたが「MV」コマンドを実行するためにPhone.Shellを使用することができます。

Sub Activity_Create(FirstTime As Boolean) 
    RenameFolder(File.DirRootExternal, "test1", "test2") 
End Sub 

Sub RenameFolder(Parent As String, CurrentFolder As String, NewFolder) 
    Dim p As Phone 
    Dim args(2) As String 
    args(0) = File.Combine(Parent, CurrentFolder) 
    args(1) = File.Combine(Parent, NewFolder) 
    p.Shell("mv", args, Null, Null) 
End Sub 
+0

あなたは「答えを受け入れる」必要があります。) – Erel

関連する問題