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

open QFile with ':' in filename

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.9.3
    • Core: I/O
    • None
    • Windows 10  64bit

      QFile::open will create wrong files when the char ':' is in the filename at certain places.

       

      #include <QFile>
      #include <QDebug>
      
      int main(int, char *[])
      {
      	QFile file("./test:.txt"); //open returns true; will create file with name: ./test
      	//QFile file("./test:txt"); //open returns true; will create file with name: ./test
      	//QFile file("./:.txt"); //open returns false
      	//QFile file("./test:."); //open returns false
      	//QFile file("./:"); //open returns false
      	//QFile file("./:test"); //open returns false
      	if(file.open(QFile::WriteOnly)){
      		qDebug() << "created";
      	} else {
      		qDebug() << "not created";
      	}
      }
      

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

            thiago Thiago Macieira
            mikeee Mike Zeller
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes