[futurebasic] Re: [FB] how to get filename

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : April 2003 : Group Archive : Group : All Groups

From: "H. Gluender" <h@...>
Date: Sat, 12 Apr 2003 13:40:18 +0200
On Saturday, April 12, 2003, Keiji Goto wrote:

>  I am looking for a means to get the filename for
>  a running application including its extension (if
>  any) under OS X. Probably I am missing something
>  and if anyone can point me to a referencial info,
>  it would be most appreciated.

******************************************************
Robert Purves wrote

See the Release 7 CD Examples  "Long file names in OS X". That demo
shows how to do the following:
convert FSSpec -> FSRef
     get name from FSRef as HFSUniStr255
         convert HFSUniStr255 -> CFStringRef
         convert CFStringRef  -> Pascal string

******************************************************

If the very application is running and you are able to find its 
ProcessSerialNumber you may gain the app's FSRef from the Process 
Manager.

err = FN GetProcessBundleLocation( psn, fsRef )



In case you are happy with an STR63 name, then you may also use

err = FN GetProcessInformation( psn, processInfo )

that returns the record item: processInfo.processName

******************************************************

HTH
-- 


                   Herbie

          ------------------------

          <http://www.gluender.de>