diff options
author | Andreas Bille <abi@openoffice.org> | 2001-07-16 10:53:40 +0000 |
---|---|---|
committer | Andreas Bille <abi@openoffice.org> | 2001-07-16 10:53:40 +0000 |
commit | c27c31544e377b83cddd3357a07062d715907ef2 (patch) | |
tree | 9825b0560c9aa2b5c797f7e3275352ae5b97c990 /ucb/source/ucp/file/filstr.cxx | |
parent | 920f09ff9ae9c217e8ef0759196021ee1a5bf7c7 (diff) |
#89377#
Now creating file if not existent
Diffstat (limited to 'ucb/source/ucp/file/filstr.cxx')
-rw-r--r-- | ucb/source/ucp/file/filstr.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ucb/source/ucp/file/filstr.cxx b/ucb/source/ucp/file/filstr.cxx index 41f3fdb15e41..4613a409d0c5 100644 --- a/ucb/source/ucp/file/filstr.cxx +++ b/ucb/source/ucp/file/filstr.cxx @@ -61,8 +61,12 @@ XStream_impl::XStream_impl( shell* pMyShell,const rtl::OUString& aUncPath ) m_nErrorCode( TASKHANDLER_NO_ERROR ), m_nMinorErrorCode( TASKHANDLER_NO_ERROR ) { - osl::FileBase::RC err = m_aFile.open( OpenFlag_Read | OpenFlag_Write ); - if( err != osl::FileBase::E_None ) + osl::FileBase::RC err,d; + if(( err = d = m_aFile.open(OpenFlag_Read | OpenFlag_Write)) == osl::FileBase::E_None || + ( d == osl::FileBase::E_NOENT && + ( err = m_aFile.open(OpenFlag_Read | OpenFlag_Write | OpenFlag_Create)) == osl::FileBase::E_None )) + m_nIsOpen = true; + else { m_nIsOpen = false; m_aFile.close(); @@ -70,8 +74,6 @@ XStream_impl::XStream_impl( shell* pMyShell,const rtl::OUString& aUncPath ) m_nErrorCode = TASKHANDLING_OPEN_FOR_STREAM; m_nMinorErrorCode = err; } - else - m_nIsOpen = true; } |