From 9fce34ad5c00a6e7238dea815dcbdb8fd8282f44 Mon Sep 17 00:00:00 2001 From: "Tim E. Sneddon" Date: Thu, 11 Apr 2013 20:48:02 +0800 Subject: [PATCH] Changed to force certain RMS FAB options if the file being created is nameless (temporary). This references issue #4. --- os_vms.c | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/os_vms.c b/os_vms.c index e21bd25..1cb6e9e 100644 --- a/os_vms.c +++ b/os_vms.c @@ -703,29 +703,32 @@ static int vmsOpen( pFile->fab.fab$b_rtv = 255; pFile->fab.fab$v_cbt = 1; - if( !zFilename ){ + if( !zFilename || !*zFilename ){ + pFile->fab.fab$v_put = 1; pFile->fab.fab$v_tmd = 1; + pFile->fab.fab$v_upd = 1; + + status = sys$create(&pFile->fab); }else{ if( flags & SQLITE_OPEN_DELETEONCLOSE ){ pFile->fab.fab$v_dlt = 1; } - } - if( flags & SQLITE_OPEN_READONLY ){ - pFile->fab.fab$v_get = 1; - } else { - pFile->fab.fab$v_put = 1; - pFile->fab.fab$v_upd = 1; - } - - if( flags & SQLITE_OPEN_EXCLUSIVE ){ - status = sys$create(&pFile->fab); - }else if( flags & SQLITE_OPEN_CREATE ){ - pFile->fab.fab$v_cif = 1; + if( flags & SQLITE_OPEN_READONLY ){ + pFile->fab.fab$v_get = 1; + }else{ + pFile->fab.fab$v_put = 1; + pFile->fab.fab$v_upd = 1; + } - status = sys$create(&pFile->fab); - }else{ - status = sys$open(&pFile->fab); + if( flags & SQLITE_OPEN_EXCLUSIVE ){ + status = sys$create(&pFile->fab); + }else if( flags & SQLITE_OPEN_CREATE ){ + pFile->fab.fab$v_cif = 1; + status = sys$create(&pFile->fab); + }else{ + status = sys$open(&pFile->fab); + } } if( $VMS_STATUS_SUCCESS(status) ){