summaryrefslogtreecommitdiff
path: root/include/osl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-05-20 18:07:54 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-05-20 18:12:33 +0200
commitf65de4feee506b80be0986ce28f7a2311e4fbe2c (patch)
treedc9bcdb650550e2e2e88c36c2024f895c17b9f6c /include/osl
parent1122d513efbb3066b4e8aefbc8dc29ce7a7e9bcf (diff)
fdo#60338: Introduce osl_createDirectoryWithFlags
...so that utl::TempFile can pass osl_File_OpenFlag_Private and doesn't have to resort to umask (the calls to umask around Directory::create had somewhat erroneously been removed recently with 1d72a0262c4570631d0aa8f98e34e21fb9d6ae42 "Related fdo#60338: Create missing temp file dir with user's original umask," mistaking this for creation of intermediate directories in the hierarchy). On Windows, the flags argument to osl_createDirectoryWithFlags is ignored completely for now. Change-Id: Iac56a5049d579be729a3f338aa62105123edb6cb
Diffstat (limited to 'include/osl')
-rw-r--r--include/osl/file.h16
-rw-r--r--include/osl/file.hxx11
2 files changed, 25 insertions, 2 deletions
diff --git a/include/osl/file.h b/include/osl/file.h
index c00a302a5c7d..1f1ae1bfe441 100644
--- a/include/osl/file.h
+++ b/include/osl/file.h
@@ -1130,6 +1130,22 @@ SAL_DLLPUBLIC oslFileError SAL_CALL osl_closeFile( oslFileHandle Handle );
SAL_DLLPUBLIC oslFileError SAL_CALL osl_createDirectory( rtl_uString* pustrDirectoryURL );
+/** Create a directory, passing flags.
+
+ @param url
+ File URL of the directory to create.
+
+ @param flags
+ A combination of the same osl_File_OpenFlag_*s used by osl_openFile,
+ except that osl_File_OpenFlag_Create is implied and ignored. Support for
+ the various flags can differ across operating systems.
+
+ @see osl_createDirectory()
+
+ @since LibreOffice 4.3
+*/
+SAL_DLLPUBLIC oslFileError SAL_CALL osl_createDirectoryWithFlags(
+ rtl_uString * url, sal_uInt32 flags);
/** Remove an empty directory.
diff --git a/include/osl/file.hxx b/include/osl/file.hxx
index 1e600e78ca80..8f7f3b4a9690 100644
--- a/include/osl/file.hxx
+++ b/include/osl/file.hxx
@@ -1849,6 +1849,10 @@ public:
@param ustrDirectoryURL [in]
Full qualified URL of the directory to create.
+ @param flags [in]
+ Optional flags, see osl_createDirectoryWithFlags for details. This
+ defaulted parameter is new since LibreOffice 4.3.
+
@return
E_None on success
E_INVAL the format of the parameters was not valid
@@ -1871,9 +1875,12 @@ public:
@see remove()
*/
- inline static RC create( const ::rtl::OUString& ustrDirectoryURL )
+ inline static RC create(
+ const ::rtl::OUString& ustrDirectoryURL,
+ sal_Int32 flags = osl_File_OpenFlag_Read | osl_File_OpenFlag_Write )
{
- return static_cast< RC >( osl_createDirectory( ustrDirectoryURL.pData ) );
+ return static_cast< RC >(
+ osl_createDirectoryWithFlags( ustrDirectoryURL.pData, flags ) );
}
/** Remove an empty directory.