Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Next Page > Hide TOC

File Manager Reference

Framework
CoreServices/CoreServices.h
Declared in
Files.h
HFSVolumes.h

Overview

The File Manager is a core service in Mac OS X that manages the organization, reading, and writing of data located on physical data storage devices such as disk drives. The File Manager provides an abstraction layer that hides lower-level implementation details such as different file systems and volume formats. If you want your application to have the same view of the file system seen in the Mac OS X user interface, the File Manager is an appropriate tool. For example, the File Manager is often used in application frameworks such as Carbon and Cocoa to implement file-related operations.

The File Manager API provides a large number of functions for performing various operations on files, directories, and volumes. The requirements of your application will dictate which of these functions you need to use. Many applications simply need to open files, read and write the data in those files, and then close the files. Other applications might provide more capabilities, such as the ability to copy or move a file to another directory. A few programs, such as the Mac OS X Finder, perform more extensive file operations and hence need to use some of the advanced functions provided by the File Manager.

A number of deprecated functions in the File Manager were inherited from earlier versions of Mac OS and have been carried along to facilitate porting legacy applications to Mac OS X. You should avoid using these deprecated functions. In particular, you should avoid any function or data structure that uses the FSSpec data type. This reference document clearly marks every deprecated function and, in most cases, provides a recommended replacement.

Functions by Task

Accessing Information About Files and Directories

Accessing the Desktop Database

Allocating Storage for Files

Closing Files

Comparing File System References

Controlling Directory Access

Controlling Login Access

Converting Between Paths and FSRef Structures

Copying and Moving Files

Copying and Moving Objects Using Asynchronous High-Level File Operations

Copying and Moving Objects Using Synchronous High-Level File Operations

Creating a File System Reference (FSRef)

Creating and Deleting File ID References

Creating and Deleting Named Forks

Creating Directories

Creating File System Specifications

Creating Files

Creating, Calling, and Deleting Universal Procedure Pointers

Deleting Files and Directories

Determining the Unicode Names of the Data and Resource Forks

Exchanging the Contents of Two Files

Getting and Setting Volume Information

Getting Volume Attributes

Iterating Over Named Forks

Locking and Unlocking File Ranges

Locking and Unlocking Files and Directories

Manipulating File and Fork Size