Share

wxWidgets

Tracker: Patches

5 better wxMacFilename2FSSpec - ID: 1564653
Last Update: Comment added ( sf-robot )

wxMacFilename2FSSpec fails to handle condition where the filename
string does not exist yet (current code converts the path string to
FSRef...
and FSRefs don't work if the file doesn't exist yet).

This patch handles all cases of converting path strings to FSSpecs.


Ryan Wilcox ( ryanwilcox ) - 2006-09-24 18:35

5

Closed

None

Stefan Csomor

Mac specific

None

Public


Comments ( 5 )

Date: 2007-04-22 02:20
Sender: sf-robotSourceForge.net Site Admin


This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).


Date: 2007-04-07 17:08
Sender: vadzProject AdminAccepting Donations


It doesn't look like this one is going to be applied so it's probably
useless to leave it open...


Date: 2006-09-25 20:16
Sender: csomorAccepting Donations

Logged In: YES
user_id=81467

Hi Ryan

I will probably completely privatize the method to make
sure it is not used anymore, and I'll add the assert, to
make sure things don't get unnoticed. Is there a call you
needed an FSSpec for which doesn't have another API ?

Best,

Stefan


Date: 2006-09-25 17:14
Sender: ryanwilcox

Logged In: YES
user_id=304442

The problem didn't happen with any wx code, but in my user code.

If you don't want to use the patch, could you at least:
a) put a #warning in wxMacFilename2FSSpec that says
FSSpecs are depreciated
b) Do some error checking of the result from
wxMacPathToFSRef (which does return the OSStatus) and
throw up a wxASSERT_MSG (or wxLogError()...) so
unwary travllers are _told_ that the operation
didn't work (instead of wondering why their FSSpec
is invalid...)


Date: 2006-09-25 05:20
Sender: csomorAccepting Donations

Logged In: YES
user_id=81467

Hi Ryan

thanks for your patch, but actually as FSSpec are
deprecated, we rather have to get rid of them completely.
wxMacFilename2FSSpec should not be used anywhere right now
in wx in any place where the file does not exist, where did
this problem happen ?
wx OS X builds IIRC currently use them only in QT,
drag&drop and NavigationServices. As FSSpecs are not
unicode aware, they should not be used for creating new
files.
What was the piece of code at the caller side that lead to
the problem ?

Thanks,

Stefan


Attached File ( 1 )

Filename Description Download
wxMacFilenameToFSSpec++.patch patch Download

Changes ( 5 )

Field Old Value Date By
status_id Pending 2007-04-22 02:20 sf-robot
close_date 2007-04-07 17:08 2007-04-22 02:20 sf-robot
status_id Open 2007-04-07 17:08 vadz
close_date - 2007-04-07 17:08 vadz
File Added 195010: wxMacFilenameToFSSpec++.patch 2006-09-24 18:35 ryanwilcox