This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: GetFInfo update
Type: Stage:
Components: macOS Versions: Python 2.2
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: jackjansen Nosy List: jackjansen, pimbuur
Priority: normal Keywords: patch

Created on 2002-06-11 07:49 by pimbuur, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
macfs.patch pimbuur, 2002-06-11 07:50 patch file for Mac:Modules:macfsmodule.c
Messages (4)
msg40268 - (view) Author: Pim Buurman (pimbuur) Date: 2002-06-11 07:49
The macfs function GetFInfo fails for directories.
This patch uses another C function to grab the
structure
msg40269 - (view) Author: Jack Jansen (jackjansen) * (Python committer) Date: 2002-06-11 21:21
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?
msg40270 - (view) Author: Pim Buurman (pimbuur) Date: 2002-06-12 06:54
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
msg40271 - (view) Author: Jack Jansen (jackjansen) * (Python committer) Date: 2002-08-06 13:00
Logged In: YES 
user_id=45365

Checked in as macfsmodule.c rev 1.57.
History
Date User Action Args
2022-04-10 16:05:24adminsetgithub: 36721
2002-06-11 07:49:59pimbuurcreate