[futurebasic] Re: [FB] Copying a file from a packaged app's resources directory

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 2008 : Group Archive : Group : All Groups

From: Robert Purves <listrp@...>
Date: Tue, 1 Jan 2008 17:04:20 +1300
Bernie wrote:

> Does anyone have some code to share that will copy a file from the  
> packaged app's resources directory to another directory. I don't  
> want to spend too much time on this, so any help appreciated. BTW,  
> the app will never be translated via FBtoC.


You could adapt this:

// arguments must be shell-escaped UTF-8
local fn CopyFileUnix( fileName as Str255, pathToSrcDir as Str255,  
pathToDestDir as Str255 )
'~'1
dim as Str255 cmd, s

cmd = "cp -p -f " + pathToSrcDir + "/" + fileName + " " + pathToDestDir
open "UNIX", 222, cmd
while ( eof( 222 ) == _false )
line input #22, s
// print s
wend
end fn


Robert P.