2 * Copyright (c) 2013 Apple Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
25 Copyright (c) 2008-2013, Apple Inc. All rights reserved.
28 #if !defined(__COREFOUNDATION_CFURLPRIV__)
29 #define __COREFOUNDATION_CFURLPRIV__ 1
31 #include <CoreFoundation/CFBase.h>
32 #include <CoreFoundation/CFError.h>
33 #include <CoreFoundation/CFArray.h>
34 #include <CoreFoundation/CFDictionary.h>
35 #include <CoreFoundation/CFString.h>
36 #include <CoreFoundation/CFURL.h>
38 #include <sys/param.h>
39 #include <sys/mount.h>
40 #include <CoreFoundation/CFFileSecurity.h>
41 #include <CoreFoundation/CFURLEnumerator.h>
42 #include <CoreFoundation/CFDate.h>
50 // Resource I/O related errors, with kCFErrorURLKey containing URL
51 kCFURLNoSuchResourceError
= 4, // Attempt to do a file system operation on a non-existent file
52 kCFURLResourceLockingError
= 255, // Couldn't get a lock on file
53 kCFURLReadUnknownError
= 256, // Read error (reason unknown)
54 kCFURLReadNoPermissionError
= 257, // Read error (permission problem)
55 kCFURLReadInvalidResourceNameError
= 258, // Read error (invalid file name)
56 kCFURLReadCorruptResourceError
= 259, // Read error (file corrupt, bad format, etc)
57 kCFURLReadNoSuchResourceError
= 260, // Read error (no such file)
58 kCFURLReadInapplicableStringEncodingError
= 261, // Read error (string encoding not applicable) also kCFStringEncodingErrorKey
59 kCFURLReadUnsupportedSchemeError
= 262, // Read error (unsupported URL scheme)
60 kCFURLReadTooLargeError
= 263, // Read error (file too large)
61 kCFURLReadUnknownStringEncodingError
= 264, // Read error (string encoding of file contents could not be determined)
62 kCFURLWriteUnknownError
= 512, // Write error (reason unknown)
63 kCFURLWriteNoPermissionError
= 513, // Write error (permission problem)
64 kCFURLWriteInvalidResourceNameError
= 514, // Write error (invalid file name)
65 kCFURLWriteInapplicableStringEncodingError
= 517, // Write error (string encoding not applicable) also kCFStringEncodingErrorKey
66 kCFURLWriteUnsupportedSchemeError
= 518, // Write error (unsupported URL scheme)
67 kCFURLWriteOutOfSpaceError
= 640, // Write error (out of storage space)
68 kCFURLWriteVolumeReadOnlyError
= 642, // Write error (readonly volume)
69 } CF_ENUM_AVAILABLE(10_5
, 2_0
);
73 Private File System Property Keys
75 CF_EXPORT
const CFStringRef _kCFURLPathKey
CF_DEPRECATED(10_6
, 10_9
, 4_0
, 7_0
);
76 /* Deprecated and scheduled for removal in 10.10/8.0 - Use the kCFURLPathKey or NSURLPathKey public property keys */
78 CF_EXPORT
const CFStringRef _kCFURLVolumeIDKey
CF_AVAILABLE(10_6
, 4_0
);
79 /* Volume ID (CFNumber) */
81 CF_EXPORT
const CFStringRef _kCFURLInodeNumberKey
CF_AVAILABLE(10_6
, 4_0
);
82 /* 64-bit inode number (the inode number from the file system) (CFNumber) */
84 CF_EXPORT
const CFStringRef _kCFURLFileIDKey
CF_AVAILABLE(10_6
, 4_0
);
85 /* 64-bit file ID (for tracking a file by ID. This may or may not be the inode number) (CFNumber) */
87 CF_EXPORT
const CFStringRef _kCFURLParentDirectoryIDKey
CF_AVAILABLE(10_6
, 4_0
);
88 /* 64-bit file ID (for tracking a parent directory by ID. This may or may not be the inode number) (CFNumber) */
90 CF_EXPORT
const CFStringRef _kCFURLDistinctLocalizedNameKey
CF_AVAILABLE(10_6
, 4_0
);
91 /* The localized name, if it is distinct from the real name. Otherwise, NULL (CFString) */
93 CF_EXPORT
const CFStringRef _kCFURLNameExtensionKey
CF_AVAILABLE(10_6
, 4_0
);
94 /* The name extension (CFString) */
96 CF_EXPORT
const CFStringRef _kCFURLFinderInfoKey
CF_AVAILABLE(10_6
, 4_0
);
97 /* A 16-byte Finder Info structure immediately followed by a 16-byte Extended Finder Info structure (CFData) */
99 CF_EXPORT
const CFStringRef _kCFURLIsCompressedKey
CF_AVAILABLE(10_6
, 4_0
);
100 /* True if resource's data is transparently compressed by the system on its storage device (CFBoolean) */
102 CF_EXPORT
const CFStringRef _kCFURLIsApplicationKey
CF_AVAILABLE(10_6
, 4_0
);
103 /* True if resource is an application (CFBoolean) */
105 CF_EXPORT
const CFStringRef _kCFURLCanSetHiddenExtensionKey
CF_AVAILABLE(10_6
, 4_0
);
106 /* True if the filename extension can be hidden or unhidden (CFBoolean) */
108 CF_EXPORT
const CFStringRef _kCFURLIsReadableKey
CF_DEPRECATED(10_6
, 10_9
, 4_0
, 7_0
);
109 /* Deprecated and scheduled for removal in 10.10/8.0 - Use the kCFURLIsReadableKey or NSURLIsReadableKey public property keys */
110 /* never implemented and scheduled for removal in 10.10/8.0 */CF_EXPORT
const CFStringRef _kCFURLUserCanReadKey
CF_DEPRECATED(10_0
, 10_6
, 2_0
, 4_0
);
112 CF_EXPORT
const CFStringRef _kCFURLIsWriteableKey
CF_DEPRECATED(10_6
, 10_9
, 4_0
, 7_0
);
113 /* Deprecated and scheduled for removal in 10.10/8.0 - Use the kCFURLIsWritableKey or NSURLIsWritableKey public property keys */
114 /* never implemented and scheduled for removal in 10.10/8.0 */CF_EXPORT
const CFStringRef _kCFURLUserCanWriteKey
CF_DEPRECATED(10_0
, 10_6
, 2_0
, 4_0
);
116 CF_EXPORT
const CFStringRef _kCFURLIsExecutableKey
CF_DEPRECATED(10_6
, 10_9
, 4_0
, 7_0
);
117 /* Deprecated and scheduled for removal in 10.10/8.0 - Use the kCFURLIsExecutableKey or NSURLIsExecutableKey public property keys */
118 /* never implemented and scheduled for removal in 10.10/8.0 */CF_EXPORT
const CFStringRef _kCFURLUserCanExecuteKey
CF_DEPRECATED(10_0
, 10_6
, 2_0
, 4_0
);
120 CF_EXPORT
const CFStringRef _kCFURLParentDirectoryIsVolumeRootKey
CF_AVAILABLE(10_6
, 4_0
);
121 /* True if the parent directory is the root of a volume (CFBoolean) */
123 CF_EXPORT
const CFStringRef _kCFURLFileSecurityKey
CF_DEPRECATED(10_6
, 10_9
, 4_0
, 7_0
);
124 /* Deprecated and scheduled for removal in 10.10/8.0 - Use the kCFURLFileSecurityKey or NSURLFileSecurityKey public property keys */
126 CF_EXPORT
const CFStringRef _kCFURLFileSizeOfResourceForkKey
CF_AVAILABLE(10_6
, 4_0
);
127 /* Size in bytes of the resource fork (CFNumber) */
129 CF_EXPORT
const CFStringRef _kCFURLFileAllocatedSizeOfResourceForkKey
CF_AVAILABLE(10_6
, 4_0
);
130 /* Size in bytes of the blocks allocated for the resource fork (CFNumber) */
132 CF_EXPORT
const CFStringRef _kCFURLEffectiveIconImageDataKey
CF_AVAILABLE(10_6
, 4_0
);
133 /* Icon image data, i.e. raw pixel data (CFData) */
135 CF_EXPORT
const CFStringRef _kCFURLCustomIconImageDataKey
CF_AVAILABLE(10_6
, 4_0
);
136 /* Icon image data of the item's custom icon, if any (CFData) */
138 CF_EXPORT
const CFStringRef _kCFURLEffectiveIconFlattenedReferenceDataKey
CF_AVAILABLE(10_6
, 4_0
);
139 /* Icon flattened reference, suitable for cheaply sharing the effective icon reference across processess (CFData) */
141 CF_EXPORT
const CFStringRef _kCFURLBundleIdentifierKey
CF_AVAILABLE(10_6
, 4_0
);
142 /* If resource is a bundle, the bundle identifier (CFString) */
144 CF_EXPORT
const CFStringRef _kCFURLVersionKey
CF_AVAILABLE(10_6
, 4_0
);
145 /* If resource is a bundle, the bundle version (CFBundleVersion) as a string (CFString) */
147 CF_EXPORT
const CFStringRef _kCFURLShortVersionStringKey
CF_AVAILABLE(10_6
, 4_0
);
148 /* If resource is a bundle, the bundle short version (CFBundleShortVersionString) as a string (CFString) */
150 CF_EXPORT
const CFStringRef _kCFURLOwnerIDKey
CF_DEPRECATED(10_6
, 10_9
, 4_0
, 7_0
);
151 /* Deprecated and scheduled for removal later in 10.9/7.0 since it is unused - Use the kCFURLFileSecurityKey or NSURLFileSecurityKey public property keys and CFFileSecurityGetOwner() */
153 CF_EXPORT
const CFStringRef _kCFURLGroupIDKey
CF_DEPRECATED(10_6
, 10_9
, 4_0
, 7_0
);
154 /* Deprecated and scheduled for removal later in 10.9/7.0 since it is unused - Use the kCFURLFileSecurityKey or NSURLFileSecurityKey public property keys and CFFileSecurityGetGroup() */
156 CF_EXPORT
const CFStringRef _kCFURLStatModeKey
CF_DEPRECATED(10_6
, 10_9
, 4_0
, 7_0
);
157 /* Deprecated and scheduled for removal later in 10.9/7.0 since it is unused - Use the kCFURLFileSecurityKey or NSURLFileSecurityKey public property keys and CFFileSecurityGetMode() */
159 CF_EXPORT
const CFStringRef _kCFURLLocalizedNameDictionaryKey
CF_AVAILABLE(10_7
, NA
);
160 /* For items with localized display names, the dictionary of all available localizations. The keys are the cannonical locale strings for the available localizations. (CFDictionary) */
162 CF_EXPORT
const CFStringRef _kCFURLLocalizedTypeDescriptionDictionaryKey
CF_AVAILABLE(10_7
, NA
);
163 /* The dictionary of all available localizations of the item kind string. The keys are the cannonical locale strings for the available localizations. (CFDictionary) */
165 CF_EXPORT
const CFStringRef _kCFURLApplicationCategoriesKey
CF_AVAILABLE(10_7
, NA
);
166 /* The array of category UTI strings associated with the url. (CFArray) */
168 CF_EXPORT
const CFStringRef _kCFURLApplicationHighResolutionModeIsMagnifiedKey
CF_AVAILABLE(10_7
, NA
);
169 /* True if the app runs with magnified 1x graphics on a 2x display (Per-user, CFBoolean) */
171 CF_EXPORT
const CFStringRef _kCFURLCanSetApplicationHighResolutionModeIsMagnifiedKey
CF_AVAILABLE(10_7
, NA
);
172 /* True if the app can run in either magnified or native resolution modes (Read only, CFBoolean) */
174 CF_EXPORT
const CFStringRef _kCFURLWriterBundleIdentifierKey
CF_AVAILABLE(10_8
, NA
);
175 /* The bundle identifier of the process writing to this object (Read-write, value type CFString) */
177 CF_EXPORT
const CFStringRef _kCFURLApplicationNapIsDisabledKey
CF_AVAILABLE(10_9
, NA
);
178 /* True if app nap is disabled (Applications only, Per-user, CFBoolean) */
180 CF_EXPORT
const CFStringRef _kCFURLCanSetApplicationNapIsDisabledKey
CF_AVAILABLE(10_9
, NA
);
181 /* True if the ApplicationNapIsDisabled property value can be changed (Applications only, Read only, CFBoolean) */
183 /* Additional volume properties */
185 CF_EXPORT
const CFStringRef _kCFURLVolumeRefNumKey
CF_AVAILABLE(10_6
, 4_0
);
186 /* The Carbon File Manager's FSVolumeRefNum for the resource volume (CFNumber) */
188 CF_EXPORT
const CFStringRef _kCFURLVolumeUUIDStringKey
CF_DEPRECATED(10_6
, 10_9
, 4_0
, 7_0
);
189 /* Deprecated and scheduled for removal in 10.10/8.0 - Use the kCFURLVolumeUUIDStringKey or NSURLVolumeUUIDStringKey public property keys */
191 CF_EXPORT
const CFStringRef _kCFURLVolumeCreationDateKey
CF_DEPRECATED(10_6
, 10_9
, 4_0
, 7_0
);
192 /* Deprecated and scheduled for removal in 10.10/8.0 - Use the kCFURLVolumeCreationDateKey or NSURLVolumeCreationDateKey public property keys */
194 CF_EXPORT
const CFStringRef _kCFURLVolumeIsLocalKey
CF_DEPRECATED(10_6
, 10_9
, 4_0
, 7_0
);
195 /* Deprecated and scheduled for removal in 10.10/8.0 - Use the kCFURLVolumeIsLocalKey or NSURLVolumeIsLocalKey public property keys */
197 CF_EXPORT
const CFStringRef _kCFURLVolumeIsAutomountKey
CF_DEPRECATED(10_6
, 10_9
, 4_0
, 7_0
);
198 /* Deprecated and scheduled for removal in 10.10/8.0 - Use the kCFURLVolumeIsAutomountedKey or NSURLVolumeIsAutomountedKey public property keys */
200 CF_EXPORT
const CFStringRef _kCFURLVolumeDontBrowseKey
CF_DEPRECATED(10_6
, 10_9
, 4_0
, 7_0
);
201 /* Deprecated and scheduled for removal in 10.10/8.0 - Use the kCFURLVolumeIsBrowsableKey or NSURLVolumeIsBrowsableKey public property keys (Note: value is inverse of _kCFURLVolumeDontBrowseKey) */
203 CF_EXPORT
const CFStringRef _kCFURLVolumeIsReadOnlyKey
CF_DEPRECATED(10_6
, 10_9
, 4_0
, 7_0
);
204 /* Deprecated and scheduled for removal in 10.10/8.0 - Use the kCFURLVolumeIsReadOnlyKey or NSURLVolumeIsReadOnlyKey public property keys */
206 CF_EXPORT
const CFStringRef _kCFURLVolumeIsQuarantinedKey
CF_AVAILABLE(10_6
, 4_0
);
207 /* Mounted quarantined (CFBoolean) */
209 CF_EXPORT
const CFStringRef _kCFURLVolumeIsEjectableKey
CF_DEPRECATED(10_6
, 10_9
, 4_0
, 7_0
);
210 /* Deprecated and scheduled for removal in 10.10/8.0 - Use the kCFURLVolumeIsEjectableKey or NSURLVolumeIsEjectableKey public property keys */
212 CF_EXPORT
const CFStringRef _kCFURLVolumeIsRemovableKey
CF_DEPRECATED(10_6
, 10_9
, 4_0
, 7_0
);
213 /* Deprecated and scheduled for removal in 10.10/8.0 - Use the kCFURLVolumeIsRemovableKey or NSURLVolumeIsRemovableKey public property keys */
215 CF_EXPORT
const CFStringRef _kCFURLVolumeIsInternalKey
CF_DEPRECATED(10_6
, 10_9
, 4_0
, 7_0
);
216 /* Deprecated and scheduled for removal in 10.10/8.0 - Use the kCFURLVolumeIsInternalKey or NSURLVolumeIsInternalKey public property keys (Note: this has slightly different behavior than the public VolumeIsInternal key) */
218 CF_EXPORT
const CFStringRef _kCFURLVolumeIsExternalKey
CF_DEPRECATED(10_6
, 10_9
, 4_0
, 7_0
);
219 /* Deprecated and scheduled for removal in 10.10/8.0 - Use the kCFURLVolumeIsInternalKey or NSURLVolumeIsInternalKey public property keys (Note: this has slightly different behavior than the public VolumeIsInternal key) */
221 CF_EXPORT
const CFStringRef _kCFURLVolumeIsDiskImageKey
CF_AVAILABLE(10_6
, 4_0
);
222 /* Volume is a mounted disk image (CFBoolean) */
224 CF_EXPORT
const CFStringRef _kCFURLDiskImageBackingURLKey
CF_AVAILABLE(10_6
, 4_0
);
225 /* If volume is a mounted disk image, the URL of the backing disk image (CFURL) */
227 CF_EXPORT
const CFStringRef _kCFURLVolumeIsFileVaultKey
CF_AVAILABLE(10_6
, 4_0
);
228 /* Volume uses File Vault encryption (CFBoolean) */
230 CF_EXPORT
const CFStringRef _kCFURLVolumeIsiDiskKey
CF_DEPRECATED(10_6
, 10_9
, 4_0
, 7_0
);
231 /* Deprecated and scheduled for removal in 10.10/8.0 - there are no more iDisks */
233 CF_EXPORT
const CFStringRef _kCFURLVolumeiDiskUserNameKey
CF_DEPRECATED(10_6
, 10_9
, 4_0
, 7_0
);
234 /* Deprecated and scheduled for removal in 10.10/8.0 - there are no more iDisks */
236 CF_EXPORT
const CFStringRef _kCFURLVolumeIsLocaliDiskMirrorKey
CF_DEPRECATED(10_6
, 10_9
, 4_0
, 7_0
);
237 /* Deprecated and scheduled for removal in 10.10/8.0 - there are no more iDisks */
239 CF_EXPORT
const CFStringRef _kCFURLVolumeIsiPodKey
CF_AVAILABLE(10_6
, 4_0
);
240 /* Volume is on an iPod (CFBoolean) */
242 CF_EXPORT
const CFStringRef _kCFURLVolumeIsCDKey
CF_AVAILABLE(10_6
, 4_0
);
243 /* Volume is a CD (audio or CD-ROM). (CFBoolean) */
245 CF_EXPORT
const CFStringRef _kCFURLVolumeIsDVDKey
CF_AVAILABLE(10_6
, 4_0
);
246 /* Volume is a DVD (CFBoolean) */
248 CF_EXPORT
const CFStringRef _kCFURLVolumeIsDeviceFileSystemKey
CF_AVAILABLE(10_7
, 5_0
);
249 /* Volume is devfs (CFBoolean) */
251 CF_EXPORT
const CFStringRef _kCFURLVolumeIsHFSStandardKey
CF_AVAILABLE(10_6
, 4_0
);
252 /* Volume is HFS standard (which includes AFP volumes). Directory IDs, but not file IDs, can be looked up. (CFBoolean) */
254 CF_EXPORT
const CFStringRef _kCFURLVolumeIOMediaIconFamilyNameKey
CF_AVAILABLE(10_9
, NA
);
255 /* Volume's IOMediaIconFamilyName. (CFStringRef) */
257 CF_EXPORT
const CFStringRef _kCFURLVolumeIOMediaIconBundleIdentifierKey
CF_AVAILABLE(10_9
, NA
);
258 /* Volume's IOMediaIconBundleIdentifier. (CFStringRef) */
260 CF_EXPORT
const CFStringRef _kCFURLResolvedFromBookmarkDataKey
CF_DEPRECATED(10_6
, 10_9
, 4_0
, 7_0
);
261 /* Deprecated and scheduled for removal later in 10.9/7.0 since it is unused (*/
263 CF_EXPORT
const CFStringRef _kCFURLVolumeMountPointStringKey
CF_AVAILABLE(10_6
, 4_0
);
264 /* the volume mountpoint string (Read-only, value type CFString) */
266 CF_EXPORT
const CFStringRef _kCFURLCompleteMountURLKey
CF_DEPRECATED(10_6
, 10_9
, 4_0
, 7_0
);
267 /* Deprecated and scheduled for removal in 10.10/8.0 - Use the kCFURLVolumeURLForRemountingKey or NSURLVolumeURLForRemountingKey public property keys */
269 CF_EXPORT
const CFStringRef _kCFURLUbiquitousItemDownloadRequestedKey
CF_AVAILABLE(10_9
, 7_0
);
270 /* Is this Ubiquity item scheduled for download? (this is also true for items that are already downloaded). Use startDownloadingUbiquitousItemAtURL:error: to make this true (Read-only, value type CFBoolean) */
274 Some common boolean properties can be accessed as a bitfield
275 for better performance -- see _CFURLGetResourcePropertyFlags() and
276 _CFURLCopyResourcePropertyValuesAndFlags(), below.
279 kCFURLResourceIsRegularFile
= 0x00000001,
280 kCFURLResourceIsDirectory
= 0x00000002,
281 kCFURLResourceIsSymbolicLink
= 0x00000004,
282 kCFURLResourceIsVolume
= 0x00000008,
283 kCFURLResourceIsPackage
= 0x00000010,
284 kCFURLResourceIsSystemImmutable
= 0x00000020,
285 kCFURLResourceIsUserImmutable
= 0x00000040,
286 kCFURLResourceIsHidden
= 0x00000080,
287 kCFURLResourceHasHiddenExtension
= 0x00000100,
288 kCFURLResourceIsApplication
= 0x00000200,
289 kCFURLResourceIsCompressed
= 0x00000400,
290 kCFURLResourceIsSystemCompressed
CF_ENUM_DEPRECATED(10_6
, 10_9
, 4_0
, 7_0
)
291 = 0x00000400, /* Deprecated and scheduled for removal in 10.10/8.0 - Use kCFURLResourceIsCompressed */
292 kCFURLCanSetHiddenExtension
= 0x00000800,
293 kCFURLResourceIsReadable
= 0x00001000,
294 kCFURLResourceIsWriteable
= 0x00002000,
295 kCFURLResourceIsExecutable
= 0x00004000, /* execute files or search directories */
296 kCFURLIsAliasFile
= 0x00008000,
297 kCFURLIsMountTrigger
= 0x00010000,
299 typedef unsigned long long CFURLResourcePropertyFlags
;
303 _CFURLGetResourceFlags - Returns a bit array of resource flags in the "flags"
304 output parameter. Only flags whose corresponding bits are set in the "mask" parameter
305 are valid in the output bit array. Returns true on success, false if an error occurs.
306 Optional output error: the error is set to a valid CFErrorRef if and only if the function
307 returns false. A valid output error must be released by the caller.
310 Boolean
_CFURLGetResourcePropertyFlags(CFURLRef url
, CFURLResourcePropertyFlags mask
, CFURLResourcePropertyFlags
*flags
, CFErrorRef
*error
) CF_AVAILABLE(10_6
, 4_0
);
314 File resource properties which can be obtained with _CFURLCopyFilePropertyValuesAndFlags().
316 typedef CF_OPTIONS(unsigned long long, CFURLFilePropertyBitmap
) {
317 kCFURLName
= 0x0000000000000001,
318 kCFURLLinkCount
= 0x0000000000000002,
319 kCFURLVolumeIdentifier
= 0x0000000000000004,
320 kCFURLObjectIdentifier
= 0x0000000000000008,
321 kCFURLCreationDate
= 0x0000000000000010,
322 kCFURLContentModificationDate
= 0x0000000000000020,
323 kCFURLAttributeModificationDate
= 0x0000000000000040,
324 kCFURLFileSize
= 0x0000000000000080,
325 kCFURLFileAllocatedSize
= 0x0000000000000100,
326 kCFURLFileSizeOfResourceFork
= 0x0000000000000200,
327 kCFURLFileAllocatedSizeOfResourceFork
= 0x0000000000000400,
328 kCFURLFinderInfo
= 0x0000000000000800,
329 kCFURLFileSecurity
= 0x0000000000001000,
333 The structure where _CFURLCopyFilePropertyValuesAndFlags() returns file resource properties.
335 struct _CFURLFilePropertyValues
{
336 CFStringRef name
; /* you are responsible for releasing this if you ask for it and get it */
338 uint64_t volumeIdentifier
;
339 uint64_t objectIdentifier
;
340 CFAbsoluteTime creationDate
;
341 CFAbsoluteTime contentModificationDate
;
342 CFAbsoluteTime attributeModificationDate
;
344 uint64_t fileAllocatedSize
;
345 uint64_t fileSizeOfResourceFork
;
346 uint64_t fileAllocatedSizeOfResourceFork
;
347 uint8_t finderInfo
[32];
348 CFFileSecurityRef fileSecurity
; /* you are responsible for releasing this if you ask for it and get it */
350 typedef struct _CFURLFilePropertyValues _CFURLFilePropertyValues
;
353 _CFURLCopyResourcePropertyValuesAndFlags - Returns property values as simple types
354 whenever possible. Returns a bit array of resource flags in the "flags"
355 output parameter. Only flags whose corresponding bits are set in the "mask" parameter
356 are valid in the output bit array. Returns true on success, false if an error occurs.
357 Optional output error: the error is set to a valid CFErrorRef if and only if the function
358 returns false. A valid output error must be released by the caller.
361 Boolean
_CFURLCopyResourcePropertyValuesAndFlags( CFURLRef url
, CFURLFilePropertyBitmap requestProperties
, CFURLFilePropertyBitmap
*actualProperties
, struct _CFURLFilePropertyValues
*properties
, CFURLResourcePropertyFlags propertyFlagsMask
, CFURLResourcePropertyFlags
*propertyFlags
, CFErrorRef
*error
) CF_AVAILABLE(10_7
, 4_0
);
364 Volume property flags
366 typedef CF_OPTIONS(unsigned long long, CFURLVolumePropertyFlags
) {
367 kCFURLVolumeIsLocal
= 0x1LL
, // Local device (vs. network device)
368 kCFURLVolumeIsAutomount
= 0x2LL
, // Mounted by the automounter
369 kCFURLVolumeDontBrowse
= 0x4LL
, // Hidden from user browsing
370 kCFURLVolumeIsReadOnly
= 0x8LL
, // Mounted read-only
371 kCFURLVolumeIsQuarantined
= 0x10LL
, // Mounted with quarantine bit
372 kCFURLVolumeIsEjectable
= 0x20LL
,
373 kCFURLVolumeIsRemovable
= 0x40LL
,
374 kCFURLVolumeIsInternal
= 0x80LL
,
375 kCFURLVolumeIsExternal
= 0x100LL
,
376 kCFURLVolumeIsDiskImage
= 0x200LL
,
377 kCFURLVolumeIsFileVault
= 0x400LL
,
378 kCFURLVolumeIsLocaliDiskMirror
CF_ENUM_DEPRECATED(10_6
, 10_9
, 4_0
, 7_0
)
379 = 0x800LL
, // Deprecated and scheduled for removal in 10.10/8.0 - there are no more iDisks
380 kCFURLVolumeIsiPod
= 0x1000LL
,
381 kCFURLVolumeIsiDisk
CF_ENUM_DEPRECATED(10_6
, 10_9
, 4_0
, 7_0
)
382 = 0x2000LL
, // Deprecated and scheduled for removal in 10.10/8.0 - there are no more iDisks
383 kCFURLVolumeIsCD
= 0x4000LL
,
384 kCFURLVolumeIsDVD
= 0x8000LL
,
385 kCFURLVolumeIsDeviceFileSystem
= 0x10000LL
,
386 kCFURLVolumeIsTimeMachine
CF_ENUM_AVAILABLE_MAC(10_9
)
388 kCFURLVolumeIsAirport
CF_ENUM_AVAILABLE_MAC(10_9
)
390 kCFURLVolumeIsVideoDisk
CF_ENUM_AVAILABLE_MAC(10_9
)
392 kCFURLVolumeIsDVDVideo
CF_ENUM_AVAILABLE_MAC(10_9
)
394 kCFURLVolumeIsBDVideo
CF_ENUM_AVAILABLE_MAC(10_9
)
396 kCFURLVolumeIsMobileTimeMachine
CF_ENUM_AVAILABLE_MAC(10_9
)
398 kCFURLVolumeIsNetworkOptical
CF_ENUM_AVAILABLE_MAC(10_9
)
400 kCFURLVolumeIsBeingRepaired
CF_ENUM_AVAILABLE_MAC(10_9
)
402 kCFURLVolumeIsBeingUnmounted
CF_ENUM_AVAILABLE_MAC(10_9
)
405 // IMPORTANT: The values of the following flags must stay in sync with the
406 // VolumeCapabilities flags in CarbonCore (FileIDTreeStorage.h)
407 kCFURLVolumeSupportsPersistentIDs
= 0x100000000LL
,
408 kCFURLVolumeSupportsSearchFS
= 0x200000000LL
,
409 kCFURLVolumeSupportsExchange
= 0x400000000LL
,
410 // reserved 0x800000000LL,
411 kCFURLVolumeSupportsSymbolicLinks
= 0x1000000000LL
,
412 kCFURLVolumeSupportsDenyModes
= 0x2000000000LL
,
413 kCFURLVolumeSupportsCopyFile
= 0x4000000000LL
,
414 kCFURLVolumeSupportsReadDirAttr
= 0x8000000000LL
,
415 kCFURLVolumeSupportsJournaling
= 0x10000000000LL
,
416 kCFURLVolumeSupportsRename
= 0x20000000000LL
,
417 kCFURLVolumeSupportsFastStatFS
= 0x40000000000LL
,
418 kCFURLVolumeSupportsCaseSensitiveNames
= 0x80000000000LL
,
419 kCFURLVolumeSupportsCasePreservedNames
= 0x100000000000LL
,
420 kCFURLVolumeSupportsFLock
= 0x200000000000LL
,
421 kCFURLVolumeHasNoRootDirectoryTimes
= 0x400000000000LL
,
422 kCFURLVolumeSupportsExtendedSecurity
= 0x800000000000LL
,
423 kCFURLVolumeSupports2TBFileSize
= 0x1000000000000LL
,
424 kCFURLVolumeSupportsHardLinks
= 0x2000000000000LL
,
425 kCFURLVolumeSupportsMandatoryByteRangeLocks
= 0x4000000000000LL
,
426 kCFURLVolumeSupportsPathFromID
= 0x8000000000000LL
,
427 // reserved 0x10000000000000LL,
428 kCFURLVolumeIsJournaling
= 0x20000000000000LL
,
429 kCFURLVolumeSupportsSparseFiles
= 0x40000000000000LL
,
430 kCFURLVolumeSupportsZeroRuns
= 0x80000000000000LL
,
431 kCFURLVolumeSupportsVolumeSizes
= 0x100000000000000LL
,
432 kCFURLVolumeSupportsRemoteEvents
= 0x200000000000000LL
,
433 kCFURLVolumeSupportsHiddenFiles
= 0x400000000000000LL
,
434 kCFURLVolumeSupportsDecmpFSCompression
= 0x800000000000000LL
,
435 kCFURLVolumeHas64BitObjectIDs
= 0x1000000000000000LL
,
436 kCFURLVolumePropertyFlagsAll
= 0xffffffffffffffffLL
441 _CFURLGetVolumePropertyFlags - Returns a bit array of volume properties.
442 Only flags whose corresponding bits are set in the "mask" parameter are valid
443 in the output bit array. Returns true on success, false if an error occurs.
444 Optional output error: the error is set to a valid CFErrorRef if and only if the function
445 returns false. A valid output error must be released by the caller.
448 Boolean
_CFURLGetVolumePropertyFlags(CFURLRef url
, CFURLVolumePropertyFlags mask
, CFURLVolumePropertyFlags
*flags
, CFErrorRef
*error
) CF_AVAILABLE(10_6
, 4_0
);
451 /* _CFURLCopyResourcePropertyForKeyFromCache works like CFURLCopyResourcePropertyForKey
452 only it never causes I/O. If the property value requested is cached (or known
453 to be not available) for the resource, return TRUE and the property value. The
454 property value returned could be NULL meaning that property is not available
455 for the resource. If the property value requested is not cached or the resource,
458 Only for use by DesktopServices!
461 Boolean
_CFURLCopyResourcePropertyForKeyFromCache(CFURLRef url
, CFStringRef key
, void *cfTypeRefValue
) CF_AVAILABLE(10_8
, NA
);
463 /* _CFURLCopyResourcePropertiesForKeysFromCache works like CFURLCopyResourcePropertiesForKeys
464 only it never causes I/O. If the property values requested are cached (or known
465 to be not available) for the resource, return a CFDictionary. Property values
466 not available for the resource are not included in the CFDictionary.
467 If the values requested are not cached, return NULL.
469 Only for use by DesktopServices!
472 CFDictionaryRef
_CFURLCopyResourcePropertiesForKeysFromCache(CFURLRef url
, CFArrayRef keys
) CF_AVAILABLE(10_8
, NA
);
474 /* _CFURLCacheResourcePropertyForKey works like CFURLCopyResourcePropertyForKey
475 only it does not return the property value -- it just ensures the value is cached.
476 If no errors occur, TRUE is returned. If an error occurs, FALSE is returned
477 and the optional output error is set to a valid CFErrorRef (which must be
478 released by the caller.
480 Only for use by DesktopServices!
483 Boolean
_CFURLCacheResourcePropertyForKey(CFURLRef url
, CFStringRef key
, CFErrorRef
*error
) CF_AVAILABLE(10_8
, NA
);
485 /* _CFURLCacheResourcePropertiesForKeys works like CFURLCopyResourcePropertiesForKeys
486 only it does not return the property values -- it just ensures the values is cached.
487 If no errors occur, TRUE is returned. If an error occurs, FALSE is returned
488 and the optional output error is set to a valid CFErrorRef (which must be
489 released by the caller.
491 Only for use by DesktopServices!
494 Boolean
_CFURLCacheResourcePropertiesForKeys(CFURLRef url
, CFArrayRef keys
, CFErrorRef
*error
) CF_AVAILABLE(10_8
, NA
);
498 _CFURLSetResourcePropertyForKeyAndUpdateFileCache - Works mostly like CFURLSetResourcePropertyForKey
499 except that file system properties are updated in the URL's file cache (if it has a valid cache)
500 and dependant properties are not flushed. This means that values in the cache may not match what
501 is on the file system (see <rdar://problem/8371295> for details).
503 Only for use by DesktopServices!
506 Boolean
_CFURLSetResourcePropertyForKeyAndUpdateFileCache(CFURLRef url
, CFStringRef key
, CFTypeRef propertyValue
, CFErrorRef
*error
) CF_AVAILABLE(10_7
, NA
);
509 _CFURLCreateDisplayPathComponentsArray()
512 _FileURLCreateDisplayPathComponentsArray creates a CFArray of
513 CFURLs for each component in the path leading up to the target
514 URL. This routine is suitable for clients who wish to show the
515 path leading up to a file system item. NOTE: This routine can be
516 I/O intensive, so use it sparingly, and cache the results if
520 The CFURLs in the result CFArray are ordered from the target URL
521 to the root of the display path. For example, if the target URL
522 is file://localhost/System/Library/ the CFURLs in the array will
523 be ordered: file://localhost/System/Library/,
524 file://localhost/System/, and then file://localhost/
532 A pointer to a CFErrorRef, or NULL. If error is non-NULL and
533 the function result is NULL, this will be filled in with a
534 CFErrorRef representing the error that occurred.
537 A CFArray or NULL if an error occurred.
540 CFArrayRef
_CFURLCreateDisplayPathComponentsArray(CFURLRef url
, CFErrorRef
*error
) CF_AVAILABLE(10_7
, 4_0
);
542 /* Returns true for URLs that locate file system resources. */
544 Boolean
_CFURLIsFileURL(CFURLRef url
) CF_AVAILABLE(10_6
, 4_0
);
546 /* Deprecated and scheduled for removal in 10.10/8.0 - Use the public API CFURLIsFileReferenceURL() */
548 Boolean
_CFURLIsFileReferenceURL(CFURLRef url
) CF_DEPRECATED(10_6
, 10_9
, 4_0
, 7_0
);
550 /* For use by Core Services */
552 void *__CFURLResourceInfoPtr(CFURLRef url
) CF_AVAILABLE(10_6
, 4_0
);
555 void __CFURLSetResourceInfoPtr(CFURLRef url
, void *ptr
) CF_AVAILABLE(10_6
, 4_0
);
558 struct FSCatalogInfo
;
561 /* _CFURLGetCatalogInfo is used by LaunchServices */
563 SInt32
_CFURLGetCatalogInfo(CFURLRef url
, UInt32 whichInfo
, struct FSCatalogInfo
*catalogInfo
, struct HFSUniStr255
*name
) CF_AVAILABLE(10_7
, 5_0
);
565 /* _CFURLReplaceObject SPI */
567 /* options for _CFURLReplaceObject */
569 // _CFURLItemReplacementUsingOriginalMetadataOnly = 1, // not used
570 _CFURLItemReplacementUsingNewMetadataOnly
= 2,
571 // _CFURLItemReplacementByMergingMetadata = 3, // not used
572 _CFURLItemReplacementWithoutDeletingBackupItem
= 1 << 4
576 Boolean
_CFURLReplaceObject( CFAllocatorRef allocator
, CFURLRef originalItemURL
, CFURLRef newItemURL
, CFStringRef newName
, CFStringRef backupItemName
, CFOptionFlags options
, CFURLRef
*resultingURL
, CFErrorRef
*error
) CF_AVAILABLE(10_7
, 5_0
);
579 #if (TARGET_OS_MAC) || CF_BUILDING_CF || NSBUILDINGFOUNDATION
581 CFURLEnumeratorResult
_CFURLEnumeratorGetURLsBulk(CFURLEnumeratorRef enumerator
, CFIndex maximumURLs
, CFIndex
*actualURLs
, CFURLRef
*urls
, CFErrorRef
*error
) CF_AVAILABLE(10_6
, 4_0
);
587 kCFBookmarkFileCreationWithoutOverwritingExistingFile
= ( 1UL << 8 ), // if destination file already exists don't overwrite it and return an error
588 kCFBookmarkFileCreationWithoutAppendingAliasExtension
= ( 1UL << 9 ), // don't add / change whatever extension is on the created alias file
589 kCFBookmarkFileCreationWithoutCreatingResourceFork
= ( 1UL << 10 ), // don't create the resource-fork half of the alias file
591 kCFURLBookmarkCreationAllowCreationIfResourceDoesNotExistMask
= ( 1 << 28 ), // allow creation of a bookmark to a file: scheme with a CFURLRef of item which may not exist. If the filesystem item does not exist, the created bookmark contains essentially no properties beyond the url string.
593 kCFURLBookmarkCreationDoNotIncludeSandboxExtensionsMask
= ( 1 << 29 ), // If set, sandbox extensions are not included in created bookmarks. Ordinarily, bookmarks ( except those created suitable for putting into a bookmark file ) will have a sandbox extension added for the item
597 kCFBookmarkResolutionPerformRelativeResolutionFirstMask
CF_ENUM_AVAILABLE(10_8
,6_0
) = ( 1 << 11 ), // perform relative resolution before absolute resolution. If this bit is set, for this to be useful a relative URL must also have been passed in and the bookmark when created must have been created relative to another url.
600 typedef CF_ENUM(CFIndex
, CFURLBookmarkMatchResult
) {
601 kCFURLBookmarkComparisonUnableToCompare
= 0x00000000, /* the two bookmarks could not be compared for some reason */
602 kCFURLBookmarkComparisonNoMatch
= 0x00001000, /* Bookmarks do not refer to the same item */
603 kCFURLBookmarkComparisonUnlikelyToMatch
= 0x00002000, /* it is unlikely that the two items refer to the same filesystem item */
604 kCFURLBookmarkComparisonLikelyToMatch
= 0x00004000, /* it is likely that the two items refer to the same filesystem item ( but, they may not ) */
605 kCFURLBookmarkComparisonMatch
= 0x00008000, /* the two items refer to the same item, but other information in the bookmarks may not match */
606 kCFURLBookmarkComparisonExactMatch
= 0x0000f000 /* the two bookmarks are identical */
609 /* The relativeToURL and matchingPropertyKeys parameters are not used and are ignored */
611 CFURLBookmarkMatchResult
_CFURLBookmarkDataCompare(CFDataRef bookmark1Ref
, CFDataRef bookmark2Ref
, CFURLRef relativeToURL
, CFArrayRef
* matchingPropertyKeys
) CF_AVAILABLE(10_7
, NA
);
614 OSStatus
_CFURLBookmarkDataToAliasHandle(CFDataRef bookmarkRef
, void* aliasHandleP
) CF_AVAILABLE(10_7
, NA
);
619 The following are properties that can be asked of bookmark data objects in addition to the resource properties
623 extern const CFStringRef kCFURLBookmarkOriginalPathKey
CF_AVAILABLE(10_7
, 5_0
);
624 extern const CFStringRef kCFURLBookmarkOriginalRelativePathKey
CF_AVAILABLE(10_7
, 5_0
);
625 extern const CFStringRef kCFURLBookmarkOriginalRelativePathComponentsArrayKey
CF_AVAILABLE(10_7
, 5_0
);
626 extern const CFStringRef kCFURLBookmarkOriginalVolumeNameKey
CF_AVAILABLE(10_7
, 5_0
);
627 extern const CFStringRef kCFURLBookmarkOriginalVolumeCreationDateKey
CF_AVAILABLE(10_7
, 5_0
);
629 #endif /* TARGET_OS_MAC */
633 #endif /* ! __COREFOUNDATION_CFURLPRIV__ */