diff options
author | Oliver Bolte <obo@openoffice.org> | 2003-10-22 10:04:37 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2003-10-22 10:04:37 +0000 |
commit | d863fb64c4b65c5d1e80d21f76f8a035286f2785 (patch) | |
tree | d513d3e8c71cdc9ab4029d66a7657e647b5a1997 /codemaker | |
parent | ea34dad332703ac975c505c5dc66e9c6bc97cc2a (diff) |
#112751# change for unix only
Diffstat (limited to 'codemaker')
-rw-r--r-- | codemaker/source/codemaker/global.cxx | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/codemaker/source/codemaker/global.cxx b/codemaker/source/codemaker/global.cxx index 1c7f2dede..b7db76f3f 100644 --- a/codemaker/source/codemaker/global.cxx +++ b/codemaker/source/codemaker/global.cxx @@ -2,9 +2,9 @@ * * $RCSfile: global.cxx,v $ * - * $Revision: 1.19 $ + * $Revision: 1.20 $ * - * last change: $Author: obo $ $Date: 2003-10-22 09:23:30 $ + * last change: $Author: obo $ $Date: 2003-10-22 11:04:37 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -335,8 +335,12 @@ FileStream::FileStream(const OString& name, FileAccessMode mode) osl_File_Attribute_OthRead; OUString sUrl(convertToFileUrl(name)); +#ifdef SAL_UNX if (osl_openFile(sUrl.pData, &m_file, checkAccessMode(mode)) == osl_File_E_None && osl_setFileAttributes(sUrl.pData, uAttr) == osl_File_E_None) +#else + if (osl_openFile(sUrl.pData, &m_file, checkAccessMode(mode)) == osl_File_E_None) +#endif m_name = name; else m_file = NULL; @@ -375,12 +379,15 @@ void FileStream::createTempFile(const OString& sPath) 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 +#ifdef SAL_UNX + if (osl_setFileAttributes(sTmpName.pData, uAttr) != osl_File_E_None) { m_file = NULL; + return; + } +#endif + OUString sSysTmpName; + FileBase::getSystemPathFromFileURL(sTmpName, sSysTmpName); + m_name = OUStringToOString(sSysTmpName, osl_getThreadTextEncoding()); } else m_file = NULL; } |