Skip to content

Commit

Permalink
Changed to force certain RMS FAB options if the file being created is
Browse files Browse the repository at this point in the history
nameless (temporary).

This references issue #4.
  • Loading branch information
tesneddon committed Apr 11, 2013
1 parent be727d3 commit 9fce34a
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions os_vms.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) ){
Expand Down

0 comments on commit 9fce34a

Please sign in to comment.