Path: utzoo!attcan!uunet!lll-winken!ames!killer!pollux!ti-csl!m2!holland From: holland@m2.csc.ti.com (Fred Hollander) Newsgroups: comp.sys.mac.programmer Subject: Re: Open Resource File List Message-ID: <67107@ti-csl.CSNET> Date: 13 Jan 89 03:37:45 GMT References: <67009@ti-csl.CSNET> <6265@hoptoad.uucp> Sender: news@ti-csl.CSNET Reply-To: holland@m2.UUCP (Fred Hollander) Organization: TI Computer Science Center, Dallas Lines: 39 In article <6265@hoptoad.uucp> tim@hoptoad.UUCP (Tim Maroney) writes: >In article <67009@ti-csl.CSNET> holland@mips.csc.ti.com (Fred Hollander) write > >>Another resource problem. I need to temporarily change the permission of a >>resource file. Right now I CloseResFile and OpenRFPerm, but I'm worried >>about the path number changing > >I would strongly recommend against trying to do this. Why do you want >to change the permission? The Mac has no way in the file system of >changing the access permission on an open file. If you close and >re-open the file, then you may very well wind up with a different >reference number. Reference numbers are offsets into the file control My concern exactly. I was also alerted to the fact that handles to open resources would be invalidated. I didn't intend to use this method, it was a temporary hack to test the effect of write-protecting a file. I was hoping someone could tell me the proper way to change the file protection. >block table; when you open a file, the offset to the lowest unused FCB >is used. So, if another file has closed since the resource file was >opened, you will change the reference number and the application will >become confused. Not only that, but if another resource file has >opened since your resource file was opened, you are changing the search >path order. In my immodest opinion, a patch that does this is a broken >patch. Don't. Ok, I won't. Thanks for telling me that the Mac file system cannot change the permission of an open file. At least I can stop looking. Anyway, I think I I have another approach that's a little cleaner. >-- >Tim Maroney, Consultant, Eclectic Software, sun!hoptoad!tim Fred Hollander Computer Science Center Texas Instruments, Inc. holland%ti-csl@csnet-rela The above statements are my own and not representative of Texas Instruments.