XBR1YD14@DDATHD21.BITNET (Reinhard Goeth - TH Darmstadt HRZ) (05/10/86)
I've a program (installed with SYSPRV) that creates a file on the directory of the account MAILER. After closing the file it is renamed and processed by the MAILER process. If my program is interrupted (because of an error or because someone pressed CONTROL/Y) while writing the file I'll get a file that's uselessm and must be deleted by the system manager. I've experimented with several RMS options (for example FAB$M_DLT, FAB$M_TMD, FAB$M_TMP) to get the file deleted if the program is interrupted but I'd no success. Either the file was not deleted after interrupting the program or the file was always deleted after closing it. Which RMS option can I use before/after $OPEN/$CONNECT/$PUT/$CLOSE ? Thanks Reinhard Goeth (TH Darmstadt Comp. Center)
LEICHTER-JERRY@YALE.ARPA (05/13/86)
I've a program (installed with SYSPRV) that creates a file on the directory of the account MAILER. After closing the file it is renamed and processed by the MAILER process. If my program is interrupted (because of an error or because someone pressed CONTROL/Y) while writing the file I'll get a file that's useless and must be deleted by the system manager. I've experimented with several RMS options (for example FAB$M_DLT, FAB$M_TMD, FAB$M_TMP) to get the file deleted if the program is interrupted but I'd no success. Either the file was not deleted after interrupting the program or the file was always deleted after closing it. Which RMS option can I use before/after $OPEN/$CONNECT/$PUT/$CLOSE ? Thanks Reinhard Goeth (TH Darmstadt Comp. Center) There are at least two ways to do this: - Open the file with the DLT bit set in the FAB, but change that just before closing the file; it's the final value that matters. (TMP means that no directory entry is to be made for the file, so you can't expect to ever get it back. TMD means make a directory entry but mark it for delete. I THINK DLT will do what you want, but its possible that RMS rundown will NOT delete the file if the program fails; in that case, try TMD.) The important point is just that you can change the bit before the file is closed. - Establish an exit handler that deletes the file if the program hasn't completed execution. (Basically, if at the time the exit handler runs, the file is still open, kill it.) -- Jerry -------