[futurebasic] Re: [FB] CFURLRefs From Unix Filenames

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : August 2010 : Group Archive : Group : All Groups

From: Brian S <fblistserve@...>
Date: Tue, 3 Aug 2010 14:08:47 -0700
On Aug 3, 2010, at 12:42 PM, Deep wrote:

> Anyone know how to get the CFURLRef where the path is shown using relative
> addressing such as "~/Desktop/myFile.txt" rather than written in full?


Have you tried the File Directory utilities ( Examples/Files/File_Directory examples )?

The steps would be:

(1) Get an FSRef ( or CFURLRef ) to the desktop:

dim as FSRef             deskRef, dataFileRef
theErr = fn FD_SpecialDirectoryGetFSRef(_kUserDomain, _kDesktopFolderType, @deskRef )



(2) Get the FSRef ( or CFURLRef ) to the file based on the Ref/url to the desktop:

fn FD_PathGetFSRef( @“myFile.txt”, @deskRef, @dataFileRef )

or 

FD_PathCreateCFURL   // to get the CFURLRef.



Brian S