public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Qt5: QDir::mkpath() fails for /cygdrive/ paths
@ 2015-07-09 19:15 David Stacey
  2015-08-12 21:59 ` David Stacey
  0 siblings, 1 reply; 4+ messages in thread
From: David Stacey @ 2015-07-09 19:15 UTC (permalink / raw)
  To: cygwin

QDir::mkpath() fails when creating paths that start '/cygdrive/'. This 
problem is only shown with Qt5 (not Qt4), and only with paths that start 
'/cygdrive/' (so running from my home directory '~' is fine). This is 
not a permissions problem, as it works fine with Qt4.

Sample programme is below. Compile for Qt5 as per the comments. 'cd 
/cygdrive/X' where X is a local drive where you have permissions to 
create a directory. Run './create_directory new_dir' and it fails to 
create the directory. Programme works fine when compiled with Qt4.

I am using libQt5Core5-5.4.1-4 and libQt4-4.8.7-1 under cygwin-2.0.4-1. 
I haven't had chance to try with Qt 5.4.2 (announced yesterday), so 
apologies in advance if this is fixed already.

Dave.


// Programme to create a directory.
// Works with Qt4:
// g++ -I/usr/include/qt4 -o create_directory create_directory.cpp -lQtCore
//
// Fails with Qt5 if run from a path starting '/cygdrive/', otherwise OK:
// g++ -I/usr/include/qt5 -o create_directory create_directory.cpp -lQt5Core

#include <QtCore/QDir>
#include <iostream>

int main(int argc, char** argv)
{
   if (argc != 2)
     std::cerr << "Syntax: create_directory <name>";
   else
   {
     QDir dir(QDir::currentPath());
     if (!dir.mkpath(argv[1]))
       std::cerr << "Failed to create directory '"
                 << argv[1] << "'." << std::endl;
   }
   return 0;
}




--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Qt5: QDir::mkpath() fails for /cygdrive/ paths
  2015-07-09 19:15 Qt5: QDir::mkpath() fails for /cygdrive/ paths David Stacey
@ 2015-08-12 21:59 ` David Stacey
  2015-08-12 23:50   ` Andrey Repin
  2015-08-13 16:39   ` Corinna Vinschen
  0 siblings, 2 replies; 4+ messages in thread
From: David Stacey @ 2015-08-12 21:59 UTC (permalink / raw)
  To: cygwin

On 09/07/2015 20:14, David Stacey wrote:
> QDir::mkpath() fails when creating paths that start '/cygdrive/'. This 
> problem is only shown with Qt5 (not Qt4), and only with paths that 
> start '/cygdrive/' (so running from my home directory '~' is fine). 
> This is not a permissions problem, as it works fine with Qt4.
>
> Sample programme is below. Compile for Qt5 as per the comments. 'cd 
> /cygdrive/X' where X is a local drive where you have permissions to 
> create a directory. Run './create_directory new_dir' and it fails to 
> create the directory. Programme works fine when compiled with Qt4.

I have updated to libQt5Core5-5.4.2-2, and I'm still getting this 
problem. Is anyone else able to reproduce this, or offer some insight as 
to why it might be failing? For completeness, my example programme is 
included below.

Dave.


// Programme to create a directory.
// Works with Qt4:
// g++ -I/usr/include/qt4 -o create_directory create_directory.cpp -lQtCore
//
// Fails with Qt5 if run from a path starting '/cygdrive/', otherwise OK:
// g++ -I/usr/include/qt5 -o create_directory create_directory.cpp 
-lQt5Core

#include <QtCore/QDir>
#include <iostream>

int main(int argc, char** argv)
{
   if (argc != 2)
     std::cerr << "Syntax: create_directory <name>";
   else
   {
     QDir dir(QDir::currentPath());
     if (!dir.mkpath(argv[1]))
       std::cerr << "Failed to create directory '"
                 << argv[1] << "'." << std::endl;
   }
   return 0;
}




--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Qt5: QDir::mkpath() fails for /cygdrive/ paths
  2015-08-12 21:59 ` David Stacey
@ 2015-08-12 23:50   ` Andrey Repin
  2015-08-13 16:39   ` Corinna Vinschen
  1 sibling, 0 replies; 4+ messages in thread
From: Andrey Repin @ 2015-08-12 23:50 UTC (permalink / raw)
  To: David Stacey, cygwin

Greetings, David Stacey!

>> QDir::mkpath() fails when creating paths that start '/cygdrive/'. This
>> problem is only shown with Qt5 (not Qt4), and only with paths that 
>> start '/cygdrive/' (so running from my home directory '~' is fine). 
>> This is not a permissions problem, as it works fine with Qt4.
>>
>> Sample programme is below. Compile for Qt5 as per the comments. 'cd 
>> /cygdrive/X' where X is a local drive where you have permissions to 
>> create a directory. Run './create_directory new_dir' and it fails to 
>> create the directory. Programme works fine when compiled with Qt4.

> I have updated to libQt5Core5-5.4.2-2, and I'm still getting this 
> problem. Is anyone else able to reproduce this, or offer some insight as 
> to why it might be failing? For completeness, my example programme is 
> included below.

QDir in Qt5 have known issues. A number of them. One serious issues is a
failure to treat international (UNICODE) paths. Probably related to all
unicode handling in that area.
Hang on the updates channel to see them resolved.

> Dave.


> // Programme to create a directory.
> // Works with Qt4:
> // g++ -I/usr/include/qt4 -o create_directory create_directory.cpp -lQtCore
> //
> // Fails with Qt5 if run from a path starting '/cygdrive/', otherwise OK:
> // g++ -I/usr/include/qt5 -o create_directory create_directory.cpp 
> -lQt5Core

> #include <QtCore/QDir>
> #include <iostream>

> int main(int argc, char** argv)
> {
>    if (argc != 2)
>      std::cerr << "Syntax: create_directory <name>";
>    else
>    {
>      QDir dir(QDir::currentPath());
>      if (!dir.mkpath(argv[1]))
>        std::cerr << "Failed to create directory '"
>                  << argv[1] << "'." << std::endl;
>    }
>    return 0;
> }


-- 
With best regards,
Andrey Repin
Thursday, August 13, 2015 02:37:16

Sorry for my terrible english...


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Qt5: QDir::mkpath() fails for /cygdrive/ paths
  2015-08-12 21:59 ` David Stacey
  2015-08-12 23:50   ` Andrey Repin
@ 2015-08-13 16:39   ` Corinna Vinschen
  1 sibling, 0 replies; 4+ messages in thread
From: Corinna Vinschen @ 2015-08-13 16:39 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1104 bytes --]

On Aug 12 22:59, David Stacey wrote:
> On 09/07/2015 20:14, David Stacey wrote:
> >QDir::mkpath() fails when creating paths that start '/cygdrive/'. This
> >problem is only shown with Qt5 (not Qt4), and only with paths that start
> >'/cygdrive/' (so running from my home directory '~' is fine). This is not
> >a permissions problem, as it works fine with Qt4.
> >
> >Sample programme is below. Compile for Qt5 as per the comments. 'cd
> >/cygdrive/X' where X is a local drive where you have permissions to create
> >a directory. Run './create_directory new_dir' and it fails to create the
> >directory. Programme works fine when compiled with Qt4.
> 
> I have updated to libQt5Core5-5.4.2-2, and I'm still getting this problem.
> Is anyone else able to reproduce this, or offer some insight as to why it
> might be failing? For completeness, my example programme is included below.

I guess somebody has to debug this... :}


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-08-13 16:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-09 19:15 Qt5: QDir::mkpath() fails for /cygdrive/ paths David Stacey
2015-08-12 21:59 ` David Stacey
2015-08-12 23:50   ` Andrey Repin
2015-08-13 16:39   ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).