]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/carbon/utilsexc.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Execution-related utilities
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 //#pragma implementation
16 #include "wx/wxprec.h"
20 #endif //ndef WX_PRECOMP
24 #include "wx/mac/private.h"
25 #include "LaunchServices.h"
27 long wxExecute(const wxString
& command
, int flags
, wxProcess
*WXUNUSED(handler
))
29 wxASSERT_MSG( flags
== wxEXEC_ASYNC
,
30 wxT("wxExecute: Only wxEXEC_ASYNC is supported") );
34 err
= wxMacPathToFSRef( command
, &fsRef
) ;
37 err
= LSOpenFSRef( &fsRef
, NULL
) ;
40 // 0 means execution failed. Returning non-zero is a PID, but not
41 // on Mac where PIDs are 64 bits and won't fit in a long, so we
42 // return a dummy value for now.
43 return ( err
== noErr
) ? -1 : 0;
46 #endif //ndef __DARWIN__