473,406 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

MacOS Extension Carbon.File.FSCatalogInfo file sizes should be UInt64?


If my read of the extension source (Mac/Modules/file/_Filemodule.c) is
correct, the parameter sizes specified for data and resource file sizes
are UInt32 where they should be UInt64.

In both OS9 and OSX Carbon, the MacOS File Manager (Files.h) uses
UInt64 values for data and resource filesizes.

Testing Python 2.3 and 2.4.2 on MacOS 10.3 returns 0L for the file size
values and correct values for other elements such as parentDirID:
fsRef = FSRef('LICENSE')
catinfo, d1, d2, d3 = fsRef.FSGetCatalogInfo(-1L)
catinfo.dataPhysicalSize 0 catinfo.parentDirID

2026177
in Files.h, both OS9 and OSX Carbon, the elements are UInt64:

struct FSCatalogInfo {
[...]
UInt64 dataLogicalSize;
UInt64 dataPhysicalSize;
UInt64 rsrcLogicalSize;
UInt64 rsrcPhysicalSize;
[...]
}

in _Filemodule.c the spec looks to be 32 bit:

static PyObject *FSCatalogInfo_get_dataLogicalSize(FSCatalogInfoOb ject
*self, void *closure)
{
return Py_BuildValue("l", self->ob_itself.dataLogicalSize);
}

I have, perhaps naively, just changed my local copy to use a BuildValue
parameter of "L" instead of "l" for each of these get and set methods
and this has survived my initial testing:

static PyObject *FSCatalogInfo_get_dataLogicalSize(FSCatalogInfoOb ject
*self, void *closure)
{
return Py_BuildValue("L", self->ob_itself.dataLogicalSize);
}

But my questions are:

Has anyone else seen this?

Does this seem like the right fix?

There is another routine in _Filemodule.c: FSCatalogInfo_tp_init() that
also seems to hold information relevant to parameter size. Should this
be changed as well?

If this is a bug, what's the best procedure to report this?
Sourceforge? This mailing list?

I'm porting a MacOS9 application from C++ to python and I expect to be
seeing a lot of these python macintosh filesystem extensions in the
near future!

Thanks for any help

Don

Oct 31 '05 #1
2 2764
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

donbro wrote:
| If my read of the extension source (Mac/Modules/file/_Filemodule.c) is
| correct, the parameter sizes specified for data and resource file sizes
| are UInt32 where they should be UInt64.
|
| In both OS9 and OSX Carbon, the MacOS File Manager (Files.h) uses
| UInt64 values for data and resource filesizes.
|
| Testing Python 2.3 and 2.4.2 on MacOS 10.3 returns 0L for the file size
| values and correct values for other elements such as parentDirID:
|
|
|>>>fsRef = FSRef('LICENSE')
|>>>catinfo, d1, d2, d3 = fsRef.FSGetCatalogInfo(-1L)
|>>>catinfo.dataPhysicalSize
|
| 0
|
|>>>catinfo.parentDirID
|
| 2026177
|
|
| in Files.h, both OS9 and OSX Carbon, the elements are UInt64:
|
| struct FSCatalogInfo {
| [...]
| UInt64 dataLogicalSize;
| UInt64 dataPhysicalSize;
| UInt64 rsrcLogicalSize;
| UInt64 rsrcPhysicalSize;
| [...]
| }
|
| in _Filemodule.c the spec looks to be 32 bit:
|
| static PyObject *FSCatalogInfo_get_dataLogicalSize(FSCatalogInfoOb ject
| *self, void *closure)
| {
| return Py_BuildValue("l", self->ob_itself.dataLogicalSize);
| }
|
| I have, perhaps naively, just changed my local copy to use a BuildValue
| parameter of "L" instead of "l" for each of these get and set methods
| and this has survived my initial testing:
|
| static PyObject *FSCatalogInfo_get_dataLogicalSize(FSCatalogInfoOb ject
| *self, void *closure)
| {
| return Py_BuildValue("L", self->ob_itself.dataLogicalSize);
| }
|
| But my questions are:
|
| Has anyone else seen this?
|
| Does this seem like the right fix?
|
| There is another routine in _Filemodule.c: FSCatalogInfo_tp_init() that
| also seems to hold information relevant to parameter size. Should this
| be changed as well?
|
| If this is a bug, what's the best procedure to report this?
| Sourceforge? This mailing list?
|
| I'm porting a MacOS9 application from C++ to python and I expect to be
| seeing a lot of these python macintosh filesystem extensions in the
| near future!
|
| Thanks for any help
|
| Don
|
You're most likely to get a good answer to this question on the
MacPython mailing list--give that a try if you don't get a response here.
- --
Cheers,

Kevin Walzer, PhD
WordTech Software - "Tame the Terminal"
http://www.wordtech-software.com
sw at wordtech-software.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDZmj8JmdQs+6YVcoRAtkTAJ9CEYbIRy6VLY7qp304JP mcl+iXUQCdHTMT
KmJljW7loFJNKFsjFkB2aNA=
=vEVV
-----END PGP SIGNATURE-----
Oct 31 '05 #2
Kevin,

Thanks for the tip. I'll post this to the pythonmac-sig mailing
list.

Don

Nov 1 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: REM | last post by:
I have some problems. It's dilemma between BLOB, BFILE and takes care of file on file system. What it's advantage?? I import some PDF document in BLOB filed in my database. It's about 1000...
1
by: Daniel Cardoso | last post by:
I don't know what else to try - In my asp.net app, when the file name has Windows-1252 characters (like ã and ç), these characters appear, each one, as two strange characters in the file name label...
19
by: **Developer** | last post by:
When I get the image from the file the file remains locked so the Delete fails with a "used by another process" So I tried using a clone and disposing the obtained image. But that didn't fix...
3
by: Steve | last post by:
Using VB.NET, How do I convert a .txt file extension to a .xls file extension? The text file is already created and saved in a folder on the server. Thanks Steven
0
by: suryanector | last post by:
anybody knows source code for programs using Index file, inverted file operations, usage of B and B++ trees in C++ language plz send them.
3
by: nickyeng | last post by:
I wanna know whether xhtml extension needed for xhtml file? if i have xhtml code in a file, can i save that file as index.html ?
10
by: vunet.us | last post by:
What is the workaround of passign a parameter to any included asp file: <!-- #Include File="file.asp" --> This obviously does not work: <!-- #Include File="file.asp?id=123" --> Thank you
8
by: raylopez99 | last post by:
I have the latest version of Visual Studio 2008 Professional, which allows you to create resource files (this is the .resx file, no?), unlike the Express version, which does not. I am trying to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.