Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!sdd.hp.com!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!ux1.cso.uiuc.edu!lees.cogsci.uiuc.edu!resnick From: resnick@lees.cogsci.uiuc.edu (Pete Resnick) Newsgroups: comp.sys.mac.programmer Subject: Files and Drivers Message-ID: <1990Jul23.201524.13849@ux1.cso.uiuc.edu> Date: 23 Jul 90 20:15:24 GMT Sender: usenet@ux1.cso.uiuc.edu (News) Distribution: comp Organization: University of Illinois at Urbana Lines: 28 Hopefully an easy question..... I am writing a driver that will be called with the dNeedTime mechanism (accRun control call) by the system every so often. This driver gets input from a text file that I open in my control routine if certain conditions are satisfied. The problem is that I may not be able to read all of the information during one call of the routine, so (as it is written now) I leave the file open and hang on to its RefNum for the next call. 1. Is this a problem as is? Will my file stay open between calls with the file mark in the right place? I would prefer not to close it if I don't have to (if nothing else to save the time of closing, re-opening and setting the file mark each time). 2. I have the file open as fsRdPerm (read-only). If someone goes and changes the file while I am in it and the file gets shorter, am I in big trouble (i.e. will this crash the Mac), will the file just get eof immediately, or will the buffer that I am working on remain the same? pr -- Pete Resnick (...so what is a mojo, and why would one be rising?) Graduate assistant - Philosophy Department, Gregory Hall, UIUC System manager - Cognitive Science Group, Beckman Institute, UIUC Internet/ARPAnet/EDUnet : resnick@kant.cogsci.uiuc.edu BITNET (if no other way) : FREE0285@UIUCVMD