Table 2-1 File types with specialized routinesĪpps use resource files to store data that is independent of the code that uses it. Table 2-1 lists the common file types supported by the system along with information about how you access them. For these standard file formats, use the higher-level options for reading and writing the file contents. macOS and iOS provide built-in support that makes opening many types of standard file formats (such as text files, images, sounds, and property lists) much easier. Choose the Right Way to Access FilesĪlthough you can open any file and read its contents as a stream of bytes, doing so is not always the right choice. For custom file types, you may need to read the raw file data yourself. For known file types, you typically use built-in system routines to read or write the file contents and give you an object that you can use. Depending on the type of file, you may have several options. When you know the location of a file, you can then start planning the best way to access it. You can also specify locations manually by building a URL or string-based path from known directory names. The system frameworks provide many routines for obtaining references to many well-known directories, such as the Library directory and its contents. Next Previous Accessing Files and Directoriesīefore you can open a file, you first have to locate it in the file system.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |