Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-79750

Add an optional mode argument to QDir::mkdir(name [, mode]), QFile::open(...)

XMLWordPrintable

    • Icon: User Story User Story
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 6.3.0 Alpha
    • None
    • Core: I/O
    • None
    • All
    • 13
    • Team 1 Foundation_Sprint 44, Team 1 Foundation_Sprint 45, Team 2 Foundation_Sprint 46, Team 2 Foundation_Sprint 47, Team 2 Foundation_Sprint 48
    • 83f2f27bb6cac0b85cdb47365347493d8dc5feb2 (qt/qtbase/dev)

      When we create a directory, we should enable the code creating it to stipulate its mode at the time of creation so that native APIs that support this can do so directly or we do so as soon as possible thereafter if native APIs don't. The default should be conservative (only present user can access, with full access), or determined by a system-specific default (where one exists) such as umask.

      The present API requires one to create the directory, then set its permissions as a separate action; that introduces a potential race condition where it has some default set of permissions which may allow another process to do things in it before the code creating the directory sets the permissions it actually intends. In any case, specifying the mode at creation time is Good Practice and nicely convenient for the client code.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            ievgenii.meshcheriakov Ievgenii Meshcheriakov
            Eddy Edward Welbourne
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: