diff options
author | Oliver Bolte <obo@openoffice.org> | 2003-10-22 08:23:30 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2003-10-22 08:23:30 +0000 |
commit | 6a6571cddb2f589e75746cf3bd89ab42b55e9335 (patch) | |
tree | fc4e4a6d153d09455664a6940f25a8c8a22c7647 /codemaker | |
parent | 01954be0e27c61876472799bace8188c464dc03a (diff) |
#112751# permission for unix
Diffstat (limited to 'codemaker')
-rw-r--r-- | codemaker/source/codemaker/global.cxx | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/codemaker/source/codemaker/global.cxx b/codemaker/source/codemaker/global.cxx index 9d74c322c9b5..2044e4feb95d 100644 --- a/codemaker/source/codemaker/global.cxx +++ b/codemaker/source/codemaker/global.cxx @@ -2,9 +2,9 @@ * * $RCSfile: global.cxx,v $ * - * $Revision: 1.18 $ + * $Revision: 1.19 $ * - * last change: $Author: obo $ $Date: 2003-10-20 13:09:10 $ + * last change: $Author: obo $ $Date: 2003-10-22 09:23:30 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -328,8 +328,15 @@ FileStream::FileStream(const OString& name, FileAccessMode mode) { if ( name.getLength() > 0 ) { - oslFileError ret = osl_File_E_None; - if ((ret = osl_openFile(convertToFileUrl(name).pData, &m_file, checkAccessMode(mode))) == osl_File_E_None) + sal_uInt64 uAttr = osl_File_Attribute_OwnWrite | + osl_File_Attribute_OwnRead | + osl_File_Attribute_GrpWrite | + osl_File_Attribute_GrpRead | + osl_File_Attribute_OthRead; + + OUString sUrl(convertToFileUrl(name)); + if (osl_openFile(sUrl.pData, &m_file, checkAccessMode(mode)) == osl_File_E_None && + osl_setFileAttributes(sUrl.pData, uAttr) == osl_File_E_None) m_name = name; else m_file = NULL; @@ -361,11 +368,19 @@ void FileStream::createTempFile(const OString& sPath) sTmpPath = convertToFileUrl(sTmp); - oslFileError ret = osl_File_E_None; - if ((ret = osl_createTempFile(sTmpPath.pData, &m_file, &sTmpName.pData)) == osl_File_E_None) { - OUString sSysTmpName; - FileBase::getSystemPathFromFileURL(sTmpName, sSysTmpName); - m_name = OUStringToOString(sSysTmpName, osl_getThreadTextEncoding()); + sal_uInt64 uAttr = osl_File_Attribute_OwnWrite | + osl_File_Attribute_OwnRead | + osl_File_Attribute_GrpWrite | + osl_File_Attribute_GrpRead | + osl_File_Attribute_OthRead; + + if (osl_createTempFile(sTmpPath.pData, &m_file, &sTmpName.pData) == osl_File_E_None) { + if (osl_setFileAttributes(sTmpName.pData, uAttr) == osl_File_E_None) { + OUString sSysTmpName; + FileBase::getSystemPathFromFileURL(sTmpName, sSysTmpName); + m_name = OUStringToOString(sSysTmpName, osl_getThreadTextEncoding()); + } else + m_file = NULL; } else m_file = NULL; } |