Added filesystem::getUmask and filesystem::applyUmaskTo (in PathInfo.h) and
[platform/upstream/libzypp.git] / zypp / PathInfo.h
index 6e5289b..35edfcf 100644 (file)
@@ -641,6 +641,22 @@ namespace zypp
      * @return Free disk space or -1 on error.
      **/
     ByteCount df( const Pathname & path );
+
+    /**
+     * Get the current umask (file mode creation mask)
+     *
+     * @return The current umask
+     **/
+    mode_t getUmask();
+
+     /**
+     * Modify \c mode_r according to the current umask
+     * <tt>( mode_r & ~getUmask() )</tt>.
+     * \see \ref getUmask.
+     * @return The resulting permissions.
+     **/
+    inline mode_t applyUmaskTo( mode_t mode_r )
+    { return mode_r & ~getUmask(); }
     //@}
 
     /////////////////////////////////////////////////////////////////