rdiff-backup-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[rdiff-backup-users] Re: Mac resource fork question


From: John Goerzen
Subject: [rdiff-backup-users] Re: Mac resource fork question
Date: Thu, 06 Nov 2003 10:18:46 -0600
User-agent: Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.4 (Reasonable Discussion, linux)

Ben Escoto <address@hidden> writes:

> So, yes, you can back up a Mac to Linux.  Does it work reliably?

Excellent!  I will have to give it a try.

>> 2. Does it also store the Mac creator and type information?  This
>>    is not properly part of the resource fork, I believe.  Same restoration
>>    question as above applies here.
>
> No, just resource forks.  I didn't even know there were other pieces
> of Mac metadata.

I am not an expert on Macs here, but here is what I believe is the case.

Yes, there are three pieces: creator, type, and resource fork.  All
three are used less frequently in OS X, but are still often found and
have to be preserved.

The creator and type are both 4-byte fixed-length values that identify
the type of file and application used to create it.  My belief, though
I'm not certain about this, is that Python on a Mac will add some
extra fields to stat() to hold these values.  These values are simply
read and stored as strings.

The resource fork you're already aware of, and is read as a file
pointer.

I am somewhat confused by all the different versions of Python
available for a Mac.  However, at
http://www.python.org/doc/current/lib/os-file-dir.html, it says in the
section on stat():

  On Mac OS systems, the following attributes may also be available:
  st_rsize, st_creator, st_type. 

I suspect st_rsize is a count of the number of bytes in the resource
fork.  st_creator and st_type are, of course, the creator and type.

The macfs FSSpec object
(http://www.python.org/doc/current/mac/fsspec-objects.html) seems to
have functions to work with type and creator as well:

GetCreatorType()

 Return the 4-character creator and type of the file. 


SetCreatorType(creator, type)

 Set the 4-character creator and type of the file. 

There is also "Finder Info".  I do not know if this is important to
back up or not (any Mac users know?)  Anyway, that module also has:

GetFInfo()

 Return a FInfo object describing the finder info for the file. 


SetFInfo(finfo)

 Set the finder info for the file to the values given as finfo (an
FInfo object). 

It seems to have things to do with icons and locations in folders.

-- John





reply via email to

[Prev in Thread] Current Thread [Next in Thread]