FROM : Antonio Nunes
DATE : Tue Nov 27 20:43:59 2007
On 27 Nov 2007, at 10:58, Alastair Houghton wrote:
> -UTF8String and -cString are *never* right for paths. You should be
> using
> -fileSystemRepresentation.
Thanks, I adjusted that.
>
>> 2. The path could of course be either a folder or a file, but it
>> shouldn't matter whether the code coerces it to FileInfo or
>> FolderInfo in this case.
>
> Since you're talking about setting the bundle bit, it must be a
> FolderInfo, surely? In fact, it would be a good thing to check for
> a folder and error out if you don't get one.
Why yes, I suppose setting the bundle bit on a flat file doesn't make
much sense ... conceptually, at least on Mac OS X. But I do not think
in practice anything is wrong with the implementation. This would seem
to be supported by the FSChangeFinderFlags function from MoreFilesX
that Sean McBride was kind enough to point out.
>> 3. I take it there is no Apple provided Cocoa API for this purpose.
>> (At least, I couldn't find any.)
>> 4. Is there otherwise anything wrong with this code, or anything I
>> should be aware of?
>
> I don't know that the finderInfo structure is byte-swapped when it's
> retrieved, even via FSGetCatalogInfo(). As a result, you might need
> to check whether you're on an Intel machine or not.
FSChangeFinderFlags doesn't do it, so I suppose it's ok. On the other
hand since the code stems from 2005, maybe it is out of date. Anyone
care to comment on this with any authority? (My gut tells me it's not
a concern.)
António
-----------------------------------------
Forgiveness is not an occasional act;
it is a permanent attitude.
--Martin Luther King, Jr
-----------------------------------------
DATE : Tue Nov 27 20:43:59 2007
On 27 Nov 2007, at 10:58, Alastair Houghton wrote:
> -UTF8String and -cString are *never* right for paths. You should be
> using
> -fileSystemRepresentation.
Thanks, I adjusted that.
>
>> 2. The path could of course be either a folder or a file, but it
>> shouldn't matter whether the code coerces it to FileInfo or
>> FolderInfo in this case.
>
> Since you're talking about setting the bundle bit, it must be a
> FolderInfo, surely? In fact, it would be a good thing to check for
> a folder and error out if you don't get one.
Why yes, I suppose setting the bundle bit on a flat file doesn't make
much sense ... conceptually, at least on Mac OS X. But I do not think
in practice anything is wrong with the implementation. This would seem
to be supported by the FSChangeFinderFlags function from MoreFilesX
that Sean McBride was kind enough to point out.
>> 3. I take it there is no Apple provided Cocoa API for this purpose.
>> (At least, I couldn't find any.)
>> 4. Is there otherwise anything wrong with this code, or anything I
>> should be aware of?
>
> I don't know that the finderInfo structure is byte-swapped when it's
> retrieved, even via FSGetCatalogInfo(). As a result, you might need
> to check whether you're on an Intel machine or not.
FSChangeFinderFlags doesn't do it, so I suppose it's ok. On the other
hand since the code stems from 2005, maybe it is out of date. Anyone
care to comment on this with any authority? (My gut tells me it's not
a concern.)
António
-----------------------------------------
Forgiveness is not an occasional act;
it is a permanent attitude.
--Martin Luther King, Jr
-----------------------------------------
| Related mails | Author | Date |
|---|---|---|
| Antonio Nunes | Nov 26, 11:21 | |
| Antonio Nunes | Nov 26, 12:39 | |
| Sean McBride | Nov 26, 17:52 | |
| Sherm Pendley | Nov 26, 18:14 | |
| Antonio Nunes | Nov 26, 20:17 | |
| Antonio Nunes | Nov 26, 20:21 | |
| Antonio Nunes | Nov 27, 10:36 | |
| Alastair Houghton | Nov 27, 11:58 | |
| Sean McBride | Nov 27, 16:41 | |
| Antonio Nunes | Nov 27, 20:43 | |
| Antonio Nunes | Nov 27, 20:48 |






Cocoa mail archive

