Many thanks to everyone who pitched in on this one. The mystery of why the file is getting deleted remains, but I have a workaround.
Emmitt, thanks for the workaround. Creating a batch file ATT.BAT with: attrib +r getout.tag and right before exiting R:Base inserting: zip cmd /c att.bat DID work, DID put a +r flag on the file and the file no longer is deleted. Thank you! Here's what I found out: Larry: It made no difference what the file was named. Your idea of creating a second file worked ONCE, and then never again! In the complex file, I noticed that doing the output this way: SET VAR vDatabaseDir = '\NEWHS\NEWHS71' -- actually the above came from a SELECT .. INTO from a parameters ---- -- table SET VAR vOut = (.vDatabaseDir+'GETOUT.TAG') OUTPUT &vOut WRITE 'Test' OUTPUT SCR led to the file being deleted, but doing it simply: OUTPUT GETOUT.TAG WRITE 'TEST OUTPUT SCREEN did NOT lead to it being deleted. However, trying to replicate this in a simpler command file did NOT cause a problem! It just wasn't worth putting any more time into figuring out why. Mike: I believe your idea of ALWAYS having a file on disk that only SOMETIMES has the commands Set var vStatus = 'StayOut' RETURN and the rest of the time has: Set var vStatus = 'Welcome' RETURN IS the best idea, but it would have meant making way too many changes in too many places. The GETOUT.TAG file idea works EVERYWHERE else but this ONE very unlikely exception where I don't want the file deleted. Normally I ALWAYS delete it. So thanks to all - add it to the unsolved mysteries of the universe. David Blocker [EMAIL PROTECTED] 781-784-1919 Fax: 781-784-1860 Cell: 339-206-0261 ----- Original Message ----- From: "MikeB" <[EMAIL PROTECTED]> To: "RBG7-L Mailing List" <[email protected]> Sent: Sunday, December 26, 2004 6:38 PM Subject: [RBG7-L] - Re: STRAAAANGE:R:Base deletes file on exit > > > I'm not convinced that it is _R:Base_ that's deleting the file, instead of > some > > other process (it might be, but I'm not convinced). > > Back a few years when I was using some vbscripts I was setting a marker file > similar to what David is doing and Rbase would check it every iteration of a > while loop. > > I don't recall exactly what the timing issues, but I do remember it was a > timing issue. > > Now I am not sure the timing issue was due to the file being created in windows > cache and not being flushed to disk before you check on it or not, or if the > rbase process ends before it is flushed and it is killed before the disk write. > I can tell you only that I had trouble with that scenario. > > How about making the contents of the file a run statement like: > > Set Var vStatus = 'StayOut' > return > > Then have your program execute the file and check the contents of the variable > vStatus. This would negate the problem with the File Deletion. You could just > leave the file there permanently and just change the contents as necessary. > > Then when you have lots more time on your hands than you know what to do, keep > testing till you solve the mystery. > >
