Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!zaphod.mps.ohio-state.edu!usc!apple!uokmax!d.cs.okstate.edu!unx2.ucc.okstate.edu!minich From: minich@unx2.ucc.okstate.edu (Robert Minich) Newsgroups: comp.sys.mac.programmer Subject: Re: Memory Protection (was: Gripes) Message-ID: <1991Jan31.090111.28538@unx2.ucc.okstate.edu> Date: 31 Jan 91 09:01:11 GMT References: <1991Jan29.174321.19621@santra.uucp> Organization: Oklahoma State University Computer Center Lines: 28 by jmunkki@hila.hut.fi (Juri Munkki): | Assume for instance that the user opens a document. To do this, a file | is selected and the program now has a working directory number and a file | name. The program opens, reads and closes the file (no problem here). The user ^^^^^^^^^^^^^^^^^^^^^^^^^========== | then edits the file and wants to save. The program still only has the | working directory reference number, which at this time might no longer | be valid. (I might be wrong here, so please correct me. I've never really | understood when and how the numbers are allocated and deallocated. I know | they will not be deallocated, if a file is open, but I think the latest | guidelines say that files should not be left open.) You should keep the file open if the user can edit it. This _is_ in IM and is a major requirement for using shared volumes. With your approach, to users can have the same file "open" at the same time and make different changes of which only one user's get's saved. | Another interesting scenario involves copying a file. The only true way | to do it involves opening and reading the resource and data forks and | the finder info. It's a lot of work, if you want to do it reliably. What's so hard about it? What "lot of work?" If this is hard, you probably have lots of other problems ahead of you. -- |_ /| | Robert Minich | |\'o.O' | Oklahoma State University| "I'm not discouraging others from using |=(___)= | minich@d.cs.okstate.edu | their power of the pen, but mine will | U | - "Ackphtth" | continue to do the crossword." M. Ho