Jump to content
havrlisan

Cannot create directories on iOS

Recommended Posts

Question for iOS platform. Why would System.SysUtils.ForceDirectories return false for the following path:

Quote

/private/var/mobile/Containers/Data/Application/2DBA3EDB-E7AE-4633-BC13-94A47589ECDC/DEBUG (LOCALHOST)/{665ACF03-9968-4C72-915E-0BF7B4F3B102}/_preferences

 The path is a combination of TPath.GetHomePath and custom folders starting from the "DEBUG (LOCALHOST)" folder. It's a folder within the app sandbox so it shouldn't be a problem unless I'm missing something.

Share this post


Link to post

Even though this is within the app sandbox, certain directories might still have restrictions. For example, there could be permissions issues with creating directories at that specific path, especially if the app has some sort of managed or limited access to certain subdirectories.
I use the TPath.GetDocumentsPath mostly, as it felt like the least problematic one.

This path is designed to store user-generated content, documents, and files that should be backed up by iTunes and other backup solutions.


Not sure if all characters are valid there, especially the underscore, I would say yes, but better check with simpler path (e.g., without underscore, parentheses or spaces).

Edited by Rollo62
  • Like 1
  • Thanks 1

Share this post


Link to post
1 hour ago, Rollo62 said:

I use the TPath.GetDocumentsPath mostly, as it felt like the least problematic one.

Switching to Documents path fixed the issue. Thanks!

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×