Wish Add directory creation to the official ExternalStorage class

ac9ts

Active Member
Licensed User
Longtime User
This has popped up one or twice in the Questions forum. With assistance from @DonManfred, I added this for my use. Others may benefit.

For reference: https://www.b4x.com/android/forum/threads/solved-creating-sub-directory-with-externalstorage.109776/

B4X:
'Creates a new directory
Public Sub FindDirOrCreate(Parent As ExternalFile, Name As String) As ExternalFile
    Dim f As ExternalFile = FindFile(Parent, Name)
    If f.IsInitialized = False Then
        Return DocumentFileToExternalFile(Parent.Native.RunMethod("createDirectory", Array(Name)))
    Else
        Return f
    End If
End Sub
 
Top