210609 Wed

Sunny·2021년 7월 4일
0

Today I Learned

목록 보기
73/88

1. 첫 번째 학습 내용: File System Basics

A file system handles the persistent storage of data files, apps, and the files associated with the operating system itself. Therefore, the file system is one of the fundamental resources used by all processes.

The file system uses directories to create a hierarchical organization. Although the basic directory structures are similar for iOS and macOS, there are differences in the way each system organizes apps and user data.

The overarching goal is to make sure that the user’s files remain easily discoverable and that the files your code uses internally are kept out of the user’s way.

2. 두 번째 학습 내용: iOS File System

iOS Standard Directories: Where Files Reside

For security purposes, an iOS app’s interactions with the file system are limited to the directories inside the app’s sandbox directory. During installation of a new app, the installer creates a number of container directories for the app inside the sandbox directory. Each container directory has a specific role.

  • The bundle container directory holds the app’s bundle, whereas the data container directory holds data for both the app and the user.
  • The data container directory is further divided into a number of subdirectories that the app can use to sort and organize its data. The app may also request access to additional container directories—for example, the iCloud container—at runtime.

These container directories constitute the app’s primary view of the file system. 

Figure 1-1 shows a representation of the sandbox directory for an app.

An iOS app operating within its own sandbox directory

An app is generally prohibited from accessing or creating files outside its container directories. One exception to this rule is when an app uses public system interfaces to access things such as the user’s contacts or music. In those cases, the system frameworks use helper apps to handle any file-related operations needed to read from or modify the appropriate data stores.

File System Basics

File System Programming Guide

[iOS] 파일시스템(File System)

profile
iOS Developer

0개의 댓글