Help / WLanguage / WLanguage functions / Standard functions / Windows management functions / System functions
  • Managing the external cache directory of application
  • Tips for using the external cache directory of application
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
Returns the path of directory that will be used to store the data in cache on the external storage space of application.
// Save a file in cache on the external storage space
IF SysStatusExternalStorage(1) = sseAvailable THEN
sCacheDir is string = SysCacheExternalStorage(1)
IF sCacheDir <> "" THEN
fSaveText(sCacheDir + "file.txt", MyString)
<Result> = SysCacheExternalStorage(<Subscript>)
<Result>: Character string
  • Path of cache directory,
  • Empty string ("") if an error occurred.
<Subscript>: Integer
Index of the external storage space to be used (if the device includes several external storage spaces).
Remark: SysNbExternalStorage returns the number of external storage spaces found on the device.

Managing the external cache directory of application

The data found in this directory will be automatically deleted by the system:
  • if the system requires additional disk space (from Android 4.2 and only if the directory is found on non-movable memory such as a partition of the internal memory).
  • if the user want to delete the data in cache.
  • if the application is uninstalled.

Tips for using the external cache directory of application

  • Before accessing a directory located in the external storage area of the device, it is recommended to check its availability with SysStatusStorageCard.
  • The application files that must not be shared with other applications must be stored in the application directory on the internal storage space of the application. The path of the different subdirectories is returned by fCurrentDir, fExeDir, fDataDir and fCacheDir.
  • fCacheDir is used to find out the path of the cache directory on the internal memory of the device.
  • We advise you to limit the volume of data stored in cache and to delete this data as soon as it is no longer used.
Component: wd280android.jar
Minimum version required
  • Version 21
Click [Add] to post a comment

Last update: 04/06/2023

Send a report | Local help