[futurebasic] Permissions errors

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : May 2004 : Group Archive : Group : All Groups

From: Robert Covington <artlythere@...>
Date: Thu, 20 May 2004 02:32:50 -0400

I burnt a copy of Compositor and source to recent backup.

I tried to run Compositor from the CD, something I haven't tried since  
Classic days.

Worked ok. However, when I quit, and it tried to write it's prefs on  
close, I got a permissions error for File Ref 1, then file not open (as  
one might expect if getting that error in the first place, and not  
being allowed to open it then)

Now if things are happening out in the field like this, no wonder my  
regs are not the best...but how do I fix this? Nobody's ever reported  

I copied the app from the CD and ran again, and of course , now it  
works with no errors. But that's no clue, since I get to do all I want,  
having authored it, built it and being the user too?

Is this a case of writing prefs to Home/Library/Prefs (where they end  
up) instead of   Computer/Library/Application Support?

Or is this just a thing to do with OS X and CD run apps (this seems  
anomalous anyway if so compared to other apps)

I need to cure this.

I get the prefs folder this way...is this not correct anymore for OS X  
and permission madness ? What should one use instead?  Or is there some  
permission crud I need to be doing when reading and writing my file?

Write, cheap, where I need the help with permissions I think...

DEF OPEN "prefCPtr"
OPEN "O", #1,_PrefFile$,,wdRef%

and so on and so forth.

Getting locale:

DIM pBlock;128
DIM pBlk&;128
DIM @CreateFlag,@Drive%,@DirID&,@prefWDRef%
Local Fn IsPrefsFolderThere
Drive% = 0
CreateFlag = _kDontCreateFolder

D&) = _NoErr
pBlk& = @pBlock
pBlk&.ioVRefNum% = Drive%
pBlk&.ioWDDirID& = DirID&
#if Carbonlib
fn FBWDtoPBWD(@pBlk&)
IF FN OPENWD (pBlk&) = _noErr THEN prefWDRef% = pBlk&.ioVRefNum%

END FN = prefWDRef%