Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucbvax.ARPA Path: utzoo!watmath!clyde!burl!ulysses!ucbvax!info-vax From: info-vax@ucbvax.ARPA Newsgroups: fa.info-vax Subject: writing readable files... Message-ID: <9188@ucbvax.ARPA> Date: Fri, 19-Jul-85 18:52:40 EDT Article-I.D.: ucbvax.9188 Posted: Fri Jul 19 18:52:40 1985 Date-Received: Sat, 20-Jul-85 12:28:55 EDT Sender: daemon@ucbvax.ARPA Organization: University of California at Berkeley Lines: 60 From: Kevin Carosso I don't know what language your using or what the rules are in it, but I do this from Pascal (either V2 or V3) all the time. I just specify: HISTORY := NEW, SHARING := READWRITE, ORGANIZATION := SEQUENTIAL in the Pascal OPEN statement. In Pascal, "sequential" is the default file organization, EXCEPT when you specify "readwrite" sharing. Then for some reason it changes the default organization to indexed (or something). I don't know why it does that, but remember: it is a change of DEFAULT, not something that says sequential files cannot be shared. In any case, this seems to work fine. If it can be done in Pascal, it can be done in any language, though you may need a useropen routine to set the right bits in the FAB if the language doesn't give you enough control. One other thing... Due to RMS buffering, things you write won't neccessarily make into the file right away for someone else to see. What I do is a $FLUSH after I write anything significant to the file. The Pascal code looks something like: (please note that references to SYS$OUTPUT are NOT referring to a PPF, but rather to whatever file I did a logical name assignment just before running the daemon this code came from. This is to allay any fears that this only works to a PPF.) (*---------------------------------------------------------------------------*) (* * "Log" writes an entry into the current log file (SYS$OUTPUT). * We use $FLUSH to update the log file after every message is written. *) procedure Log (Message : varying [maxlen] of Char); type Unsafe_file = [UNSAFE] text; RAB_ptr = ^RAB$TYPE; var sys_output_RAB : RAB_ptr; function PAS$RAB (var F : [volatile] Unsafe_file) : RAB_ptr; extern; begin (* Log *) writeln (sys_output, Message); sys_output_RAB := PAS$RAB (sys_output); status := $FLUSH (sys_output_RAB^); if not odd (status) then LIB$SIGNAL (status); end; /Kevin Carosso engvax!kvc @ CIT-VAX.ARPA Hughes Aircraft Co. ps. Yeah, I really do write all my system-type code in Pascal... Not exactly standard Pascal, but then things I do are far from standard... VMS Pascal is pretty neat.