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

QDir mkdir can create folder which cannot be removed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.9.4, 6.2.2
    • Core: I/O
    • None
    • Windows

    Description

      Following code will create folder called "test " which contains space in end. That causes that folder cannot be removed with Windows Explorer at all.

      This happens at least in NTFS filesystem

          QDir dir(".");
          dir.mkdir("test ");
      

      If short names are enabled then workaround to remove is use command prompt to delete this folder

      dir /X
      rd <SHORT NAME>

       

      If short names are not enabled it's impossible to delete this folder in Windows.

      To check that  is short names enabled. Seems that in OS drive short names are enabled but not in non OS drive by default. 

      fsutil 8dot3name query c:
      

      If you try to do following directory from command prompt or Windows Explorer directory is created with trimmed name.

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            markom80 Marko Moilanen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes