ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / External file functions
  • Integrating resources when generating the iPhone/iPad application
  • Handling the read-only files found in the directory of resources
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Returns the path of the read-only resources of the application.
Example
// The function returns the content of the file
fLoadBuffer(fResourceDir() + ["\"] + "data.bin")
Syntax
<Result> = fResourceDir()
<Result>: Character string
Full path of the read-only resources found in the application. Corresponds to the ".app" directory of the application. You cannot write into this directory.
Remarks
iPhone/iPadIOS WidgetMac Catalyst

Integrating resources when generating the iPhone/iPad application

The iOS application generation wizard allows you to include files in the executable. You can include:
  • specific resources.
  • specific images.
  • data files.
If the "Write" option is checked for the files, these files will be automatically extracted (e.g., files that must be modified by the application). In this case, specify the application directory into which this file must be extracted ("Documents" directory or "Library" directory).
If the "Write" option is unchecked for the files, these files can be:
  • used directly (files to read for example: sound files, image files, etc.). These files are included in the application and they will not be extracted. fResourceDir is used to access these files in read-only mode.
  • extracted through programming with fExtractResource.
Caution: The iOS system is case-sensitive.
iPhone/iPadIOS WidgetMac Catalyst

Handling the read-only files found in the directory of resources

The tree structure of the resource directory is identical to the tree structure of the project directory on the development computer:
  • on the development computer, the resource included in the Xcode project can be found in a directory such as:
    <Project_Name>\EXE\<Configuration name>\<Custom directory>.
  • on iPhone or iPad, the resource will be in a directory such as:
    fResourceDir() + \EXE\<Configuration name>\<Custom directory>.
Example: the following code checks if the "stop.png" file is in the directory of the resources. On the development computer, this file is in the "C:\My Projects\MyApp\Exe\iOS Application\stop.png" directory.
On iPhone or iPad, this path corresponds to: "<Application directory>/MyApp.app/Exe/iOS Application/stop.png".
IF fFileExist(CompleteDir(fResourceDir()) + CompleteDir("Exe") + ...
CompleteDir("iOS Application") + "stop.png") = True THEN
Info("The image was found")
ELSE
Info("Image not found.")
END
Minimum version required
  • Version 17
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 08/23/2022

Send a report | Local help