summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qdir.cpp
diff options
context:
space:
mode:
authorAhmad Samir <a.samirh78@gmail.com>2025-01-21 14:35:26 +0200
committerAhmad Samir <a.samirh78@gmail.com>2025-02-27 00:12:07 +0200
commit23981aae0e059d876d441bfffae9d9d0fd671bde (patch)
tree812b94aaffd3a4242798ae590ce01cd969cd1a0c /src/corelib/io/qdir.cpp
parent122979e3a10bab3109e8d1cbb89ecf16ae6af1e6 (diff)
QDir: improve mkdir/mkpath API docs
Pick-to: 6.9 6.8 6.5 Task-number: QTBUG-132633 Change-Id: Iafe4a20bacbbf55d19377e8cd04f940d4f2a66f6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qdir.cpp')
-rw-r--r--src/corelib/io/qdir.cpp59
1 files changed, 38 insertions, 21 deletions
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp
index 227aa936318..956236f95d5 100644
--- a/src/corelib/io/qdir.cpp
+++ b/src/corelib/io/qdir.cpp
@@ -1493,22 +1493,26 @@ QFileInfoList QDir::entryInfoList(const QStringList &nameFilters, Filters filter
#endif // !QT_BOOTSTRAPPED
/*!
- Creates a sub-directory called \a dirName.
+ Creates a sub-directory called \a dirName with the given \a permissions.
- Returns \c true on success; otherwise returns \c false.
+ Returns \c true on success; returns \c false if the operation failed or
+ the directory already existed.
- If the directory already exists when this function is called, it will return \c false.
+//! [dir-creation-mode-bits-unix]
+ On POSIX systems \a permissions are modified by the
+ \l{https://pubs.opengroup.org/onlinepubs/9799919799/functions/umask.html}{\c umask}
+ (file creation mask) of the current process, which means some permission
+ bits might be disabled.
+//! [dir-creation-mode-bits-unix]
- The permissions of the created directory are set to \a{permissions}.
+ On Windows, by default, a new directory inherits its permissions from its
+ parent directory. \a permissions are emulated using ACLs. These ACLs may
+ be in non-canonical order when the group is granted less permissions than
+ others. Files and directories with such permissions will generate warnings
+ when the Security tab of the Properties dialog is opened. Granting the
+ group all permissions granted to others avoids such warnings.
- On POSIX systems the permissions are influenced by the value of \c umask.
-
- On Windows the permissions are emulated using ACLs. These ACLs may be in non-canonical
- order when the group is granted less permissions than others. Files and directories with
- such permissions will generate warnings when the Security tab of the Properties dialog
- is opened. Granting the group all permissions granted to others avoids such warnings.
-
- \sa rmdir()
+ \sa rmdir(), mkpath(), rmpath()
\since 6.3
*/
@@ -1529,10 +1533,22 @@ bool QDir::mkdir(const QString &dirName, QFile::Permissions permissions) const
/*!
\overload
- Creates a sub-directory called \a dirName with default permissions.
+ Creates a sub-directory called \a dirName with the platform-specific
+ default permissions.
+
+ Returns \c true on success; returns \c false if the operation failed or
+ the directory already existed.
- On POSIX systems the default is to grant all permissions allowed by \c umask.
- On Windows, the new directory inherits its permissions from its parent directory.
+//! [windows-permissions-acls]
+ On Windows, by default, a new directory inherits its permissions from its
+ parent directory. Permissions are emulated using ACLs. These ACLs may be
+ in non-canonical order when the group is granted less permissions than
+ others. Files and directories with such permissions will generate warnings
+ when the Security tab of the Properties dialog is opened. Granting the
+ group all permissions granted to others avoids such warnings.
+//! [windows-permissions-acls]
+
+ \sa rmdir(), mkpath(), rmpath()
*/
bool QDir::mkdir(const QString &dirName) const
{
@@ -1575,16 +1591,17 @@ bool QDir::rmdir(const QString &dirName) const
}
/*!
- Creates the directory path \a dirPath.
+ Creates a directory named \a dirPath.
- The function will create all parent directories necessary to
- create the directory.
+ If \a dirPath doesn't already exist, this method will create it - along with
+ any nonexistent parent directories - with the default permissions.
- Returns \c true if successful; otherwise returns \c false.
+ Returns \c true on success or if \a dirPath already existed; otherwise
+ returns \c false.
- If the path already exists when this function is called, it will return true.
+ \include qdir.cpp windows-permissions-acls
- \sa rmpath()
+ \sa rmpath(), mkdir(), rmdir()
*/
bool QDir::mkpath(const QString &dirPath) const
{