Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!munnari!uqcspe!miw From: miw@uqcspe.OZ (Mark Williams) Newsgroups: comp.os.vms Subject: How do you flush buffers? Message-ID: <1655@uqcspe.OZ> Date: Thu, 5-Nov-87 15:35:17 EST Article-I.D.: uqcspe.1655 Posted: Thu Nov 5 15:35:17 1987 Date-Received: Sun, 8-Nov-87 13:34:27 EST Reply-To: miw@uqcspe.cs.uq.oz (Mark Williams) Organization: Prentice Computer Centre, University of Queensland Lines: 37 G'day, I have a small problem with writing to files that perhaps someone can help me with. I am in the process of writing a program in PASCAL to collect data from the statistics port of our MICOM circuit switch. The collection part of it is ok, and the records are going obediently out to a sequential, direct access, fixed record size file. The problem is that the program has to run all the time, but we also wish to be able to read the file it is writing and get up-to date data. At this stage I am opening the file with sharing = readonly. This allows another process to access the file, but unfortunately, you can't read anything! I then set up a little timer AST routine which wakes up every 5 minutes or so, closes the file, FINDS the last element written, and attempts to TRUNCATE the file to get back to generation mode at EOF. The trouble is, PASCAL doesn't let you TRUNCATE or EXTEND a file which can be shared! So I can either read the file and get nothing, or flush the file out regularly and not be able to read it at all because it is locked. What I want to be able to do is have the file checkpointed regularly like NETSERVER.LOGs or batch LOGS, so others can read it while it is being generated. Can I do this in PASCAL with a sequential file, or do I have to use an indexed file? Is it possible to do this in FORTRAN or C? (I am no great hacker in those languages, but I suppose I could be forced if it were the best way to get this @#$% job which SHOULD be simple done) Hoping some VAX guru can help a sorcerer's apprentice, Mark Williams ARPA: ccwilliams%wombat.decnet.uq.oz@uunet.uu.net ACSNET: ccwilliams@wombat.decnet.uq PSI: PSI%050527372000090::ccwilliams -- The views expressed above are not necessarily those of my employer. In a couple of hours they may not even be my own. Small boys throw stones in fun, but the frogs die in ernest. -- Mark Twain.