### Get Application Data Folder

Windows apps are installed by default under Program Files.
Starting from Windows Vista, Program Files folders are read-only.
This means that writing to File.DirApp will fail.
File.DirData (requires minimum B4J v3.60)
Return the path to the folder that is suitable for writing.
If the folder does not exist, the folder will be created.
Folder Syntax, like: Drive:\Users\USERNAME\AppData\Roaming\APPNAME
Example
Log(File.DirApp("B4JTestApp"))
Output
C:\Users\Robert\AppData\Roaming\B4JTestApp
Sub to use as alternative (prior B4J v3.60)
The following code returns a writable folder based on the platform:
`Sub GetDataFolder (AppName As String) As String
Dim os As String = GetSystemProperty("os.name", "").ToLowerCase
If os.Contains("win") Then
Dim wf As String = File.Combine(GetEnvironmentVariable("AppData", ""), AppName)
File.MakeDir(wf, "")
Return wf
Else
Return File.DirApp
End If
End Sub`
It will return something like:
C:\Users\MyName\AppData\Roaming\AppName on Windows and File.DirApp on other platforms.

Changed: , Category: Application, File: T6C159M1160.htm, ID: 1160