Skip navigation.
 
mlRe: Best way to discover resource forks?
FROM : Chris Suter
DATE : Tue Jul 11 22:47:14 2006

On 12/07/2006, at 5:40 AM, Steve Christensen wrote:
> If you're trying to determine if a file contains resources (in 
> either fork), you'd need to try opening the fork(s) using Resource 
> Manager APIs, which would be considerably more time consuming.


I don't believe you need to open the file to find out if a file 
contains resources.

You can use the BSD function getattrlist. On Tiger you can also the 
BSD extended attribute API. See man pages for getattrlist and 
listxattr. The extended attribute name for the resource fork is 
defined by the constant XATTR_RESOURCEFORK_NAME (defined in /usr/
include/sys/xattr.h).

You can also access resource forks as if they are regular files by 
appending "/..namedfork/rsrc" to the name of the file. You may need 
to check when this was introduced if you need it to work on older 
systems.

- Chris

Related mailsAuthorDate
mlBest way to discover resource forks? Scott Ellsworth Jul 11, 19:50
mlRe: Best way to discover resource forks? Ryan Britton Jul 11, 20:31
mlRe: Best way to discover resource forks? Scott Ellsworth Jul 11, 21:14
mlRe: Best way to discover resource forks? Steve Christensen Jul 11, 21:40
mlRe: Best way to discover resource forks? Chris Suter Jul 11, 22:47
mlRe: Best way to discover resource forks? Steve Christensen Jul 11, 22:59
mlRe: Best way to discover resource forks? Scott Ellsworth Jul 11, 23:01
mlRe: Best way to discover resource forks? Uli Kusterer Jul 12, 00:30
mlRe: Best way to discover resource forks? Steve Christensen Jul 12, 01:11