"Do not back to" folder properties

Source: Internet
Author: User
Tags home screen

IOS Data Storage Guidelines

icloud includes a backup that automatically backs up users ' iOS devices every day via Wi-Fi. Everything in the app's home directory will be backed up, in addition to the app bundle itself, the cache directory, and the temp directory. Purchased music, apps, books, Camera roll, device settings, home screen, app organization, messages, ringtones will also be backed up. Because backups are done wirelessly and stored in icloud for each user, the app needs to minimize the amount of data it stores. Large files can prolong backup times and consume the user's available icloud space.
to ensure that backups are as fast and efficient as possible, applying stored data requires the following guidelines:

1. Only those user-generated documents or other data, or data that the app cannot recreate, should be stored in the <application_home>/documents directory and automatically backed up to icloud.

2. Data that can be re-downloaded or generated should be stored in the <application_home>/library/caches directory. For example, database cache files, downloadable files (magazines, newspapers, data used by map applications), etc. are in this category.

3. Temporary use of data should be stored in the <application_home>/tmp directory. Although these files will not be backed up by icloud, the app will need to remember to delete the files after use so that it does not continue to occupy the user's device space.

4. Use the Do not backup property to specify files that need to remain on the device, even if there is low storage space. This property is required for those files that can be regenerated, but remain in low storage space, have an impact on the app's uptime, or if the user wants files to be available offline. This property can be used regardless of the file (including the documents directory) in the directory. These files are not deleted and are not included in the user's icloud or itunes backup. Since these files always occupy the storage space of the user's device, it is the responsibility of the application to periodically monitor and delete these files.

5. Set extended Properties

#include <sys/xattr.h>-(BOOL) Addskipbackupattributetoitematurl: (Nsurl *) url{const char* filePath = [[URL path] Filesystemrepresentation];const char* attrname = "Com.apple.MobileBackup"; u_int8_t attrValue = 1;int result = Setxattr ( FilePath, Attrname, &attrvalue, sizeof (AttrValue), 0, 0); return result = = 0;}

Original link


For security reasons, an app can have only a few directories to write to the app's data or preference parameters. When an app is installed to the system, the app's home directory is created. The following is a list of the main subdirectories under the home directory:

<application_home>/appname.app: Store the application itself

<application_home>/documents/: Storing user documents and application data files

<application_home>/library/: The top-level directory of the application specification, the following are some specification-defined subdirectories, of course, you can also customize the subdirectory, for the application of the file, but it is not appropriate to store user data files, Same as document will be synced by itunes, but does not include caches subdirectory <application_home>/library/preferences, where the program specification requires a preference file

<application_home>/library/caches, save your app's persisted data for app upgrades or app-closed data save, not synced by itunes, so in order to reduce sync time, Consider placing files that are larger and that do not need to be backed up in this directory

<application_home>/tmp/, save the application data, but do not need to persist, after the application is closed, the data in the directory will be deleted, or the system can be cleared when the program is not running

Original link

Official documents



"Do not back to" folder properties

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.