Methods



URLByDeletingLastPathComponent

Abstract: Delete last component of a url.
- (NSURL *)URLByDeletingLastPathComponent; 

Returns a new NSURL equivelent to the receiver with the last component removed.

Result: A new NSURL

URLWithFSRef:

Abstract: Alloc and intialize a NSURL.
+ (NSURL *)URLWithFSRef:(const FSRef *)aFsRef; 

Returns a file url for the file refered to by a FSRef.

Parameters

NameDescription
aFsRefA pointer to a FSRef.
Result: A NSURL containing a file url.

URLWithFileSystemPathHFSStyle:

Abstract: Alloc and intialize a NSURL.
+ (NSURL *)URLWithFileSystemPathHFSStyle:(NSString *)aHFSString; 

Returns a file url for the file refered to by a HFS style path.

Parameters

NameDescription
aHFSStringA NSString containing a HFS style path.
Result: A NSURL containing a file url.

fileSystemPathHFSStyle

Abstract: Returns a HFS style path.
- (NSString *)fileSystemPathHFSStyle; 

Returns a NSString containg a HFS style path (e.g. Macitosh HD:Users:) useful for display purposes.

Result: A new NSString containing a HFS style path for the same file or directory as the receiver.

finderInfoFlags:type:creator:

Abstract: Get finder info flags creator and type.
- (BOOL)finderInfoFlags:(UInt16*)aFlags type:(OSType*)aType creator:(OSType*)aCreator; 

The bits of the finder info flag are

NameDescription
kIsOnDeskFiles and folders (System 6)
kColorFiles and folders
kIsSharedFiles only (Applications only)
If clear, the application needs to write to its resource fork, and therefore cannot be shared on a server
kHasNoINITsFiles only (Extensions/Control Panels only)
This file contains no INIT resource
kHasBeenInitedFiles only
Clear if the file contains desktop database resources ('BNDL', 'FREF', 'open', 'kind'...) that have not been added yet. Set only by the Finder
kHasCustomIconFiles and folders
kIsStationeryFiles only
kNameLockedFiles and folders
kHasBundleFiles only
kIsInvisibleFiles and folders
kIsAliasFiles only.

Parameters

NameDescription
aFlagsContains finder flags on return.
aTypeContains finder type on return.
aCreatorContains creator on return.
Result: Return YES if successful, otherwise NO and the returned values are invalid.

finderLocation

Abstract: Return a finder items location.
- (NSPoint)finderLocation; 

Returns a finder items location within its parent window.

Result: A NSPoint

getFSRef:

Abstract: Get a FSRef.
- (BOOL)getFSRef:(FSRef *)aFsRef; 

Obtain a FSRef for a file url.

Parameters

NameDescription
aFsRefA pointer to a FSRef struct, to be filled by the method.
Result: Returns YES if successful, if the method returns NO then aFsRef contains garbage.

getFSSpec:

Abstract: Get a FSSpec.
- (BOOL)getFSSpec:(FSSpec *)aFSSpec; 

Obtain a FSSpec for a file url.

Parameters

NameDescription
aFSSpecA pointer to a FSSpec struct, to be filled by the method.
Result: Returns YES if successful, if the method returns NO then aFSSpec contains garbage.

resolveAliasFile

Abstract: Resolve an alias file.
- (NSURL *)resolveAliasFile; 

Returns an file url NSURL refered to by the receveive if the receveive refers to an alias file. If it does not refer to an alias file the a url identical to the receveive is returned.

Result: An file url NSURL.

setFinderInfoFlags:mask:type:creator:

Abstract: Set finder info flags, creator and type.
- (BOOL)setFinderInfoFlags:(UInt16)aFlags mask:(UInt16)aMask type:(OSType)aType creator:(OSType)aCreator; 

The bits of the finder info flag are

NameDescription
kIsOnDeskFiles and folders (System 6)
kColorFiles and folders
kIsSharedFiles only (Applications only)
If clear, the application needs to write to its resource fork, and therefore cannot be shared on a server
kHasNoINITsFiles only (Extensions/Control Panels only)
This file contains no INIT resource
kHasBeenInitedFiles only
Clear if the file contains desktop database resources ('BNDL', 'FREF', 'open', 'kind'...) that have not been added yet. Set only by the Finder
kHasCustomIconFiles and folders
kIsStationeryFiles only
kNameLockedFiles and folders
kHasBundleFiles only
kIsInvisibleFiles and folders
kIsAliasFiles only.

Parameters

NameDescription
aFlagsFinder flags.
aMaskMask for Finder flags
aTypeThe Finder file type
aCreatorThe application creator code
Result: Returns YES if successful.

setFinderLocation:

Abstract: Sets the location a finder item.
- (BOOL)setFinderLocation:(NSPoint)aLocation; 

Set the location of a finder item within in container.

Parameters

NameDescription
aLocationThe location
Result: Returns YES if successful.

© 2003 Nathan Day — (Last Updated 11/30/2003)