[Patches] [ python-Patches-567296 ] GetFInfo update

noreply@sourceforge.net noreply@sourceforge.net
Tue, 11 Jun 2002 23:54:05 -0700


Patches item #567296, was opened at 2002-06-11 09:49
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=567296&group_id=5470

Category: Macintosh
Group: Python 2.2.x
Status: Open
Resolution: None
Priority: 5
Submitted By: Pim Buurman (pimbuur)
Assigned to: Jack Jansen (jackjansen)
Summary: GetFInfo update

Initial Comment:
The macfs function GetFInfo fails for directories.
This patch uses another C function to grab the
structure

----------------------------------------------------------------------

>Comment By: Pim Buurman (pimbuur)
Date: 2002-06-12 08:54

Message:
Logged In: YES 
user_id=157121

Jack, 

I also thought this would happen,
but when I set the Creator and Type of a directory,
I get the correct values.

Output:
#/Developer/Tools/GetFileInfo CVS
directory: "CVS"
type: "PIMB"
creator: "ABCD"
attributes: aVbstclinmed
created: 04/26/2002 08:50:33
modified: 06/10/2002 08:29:21

#python tstmac.py CVS
'import macfsn' failed; use -v for traceback
FSSpec((-100, 671716, 'CVS'))
<macfs.FInfo object at 0x1a9080>
creator: 'ABCD'
flags: '16384'
fldr: '0'
location: '(0, 0)'
type: 'PIMB'
dates (3102663033.0, 3106549761.0, 0.0)

So I think this function works, at least on Mac OS X, 
10.1.5

----------------------------------------------------------------------

Comment By: Jack Jansen (jackjansen)
Date: 2002-06-11 23:21

Message:
Logged In: YES 
user_id=45365

Pim,
your fix has the problem that it will put garbage into creator and type fields for folders (as the DInfo structure, which is really what is returned for directories, has different stuff at those places).

I don't like this, but I'm also unsure as to how to fix it. One solution would be to check whether the FInfo structure returned was for a directory, and don't expose the Creator and Type fields in that case, but I don't see how to do this easily.

Another option would be to leave GetFInfo as it is and add a new method GetFinderFlags() that returns only the finder flag word (as this seems the most useful bit of the data shared between FInfo and DInfo structures).

What do you think?

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=567296&group_id=5470