<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>141232</bug_id>
          
          <creation_ts>2007-02-05 19:57:56 +0000</creation_ts>
          <short_desc>Quanta+ fails to create new remote directories on some FTP servers</short_desc>
          <delta_ts>2007-02-08 05:55:20 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>Unmaintained</classification>
          <product>quanta</product>
          <component>general</component>
          <version>unspecified</version>
          <rep_platform>Compiled Sources</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Markus">darkvision</reporter>
          <assigned_to name="András Manţia">amantia</assigned_to>
          
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>506858</commentid>
    <comment_count>0</comment_count>
    <who name="Markus">darkvision</who>
    <bug_when>2007-02-05 19:57:56 +0000</bug_when>
    <thetext>Version:           3.5.5 (using KDE KDE 3.5.5)
Installed from:    Compiled From Sources
Compiler:          gcc-Version 3.4.6 
OS:                Linux

When i create a new directory in my project with a small index.html the upload will fail because the new directory cannot be created on remote server(ftp). Quanta+ tells me that i should check permissions on the FTP. But it can&apos;t be a permission problem since other uploads to existing directories do work.

I tried to find the problem and here is what i found out.

First i tried to create the new directory on my local FTP to get a list of commands Quanta+ is using during file upload. On the remote server(FTP) a folder /doc does already exist, the new directory to be created is named &quot;Test&quot;. Here&apos;s what my FTP server told me about the Quanta-commands:

[DEBUG] 257 &quot;/&quot; is your current location
[DEBUG] Command [cwd] [/doc/Test]
[INFO] Can&apos;t change directory to /doc/Test: No such file or directory
[DEBUG] 550 Can&apos;t change directory to /doc/Test: No such file or directory
[DEBUG] Command [type] [I]
[DEBUG] 200 TYPE is now 8-bit binary
[DEBUG] Command [size] [/doc/Test]
[DEBUG] 550 Can&apos;t check for file existence
[DEBUG] Command [cwd] [/doc]
[DEBUG] 250 OK. Current directory is /doc
[DEBUG] Command [mkd] [/doc/Test/]
[DEBUG] 257 &quot;/doc/Test/&quot; : The directory was successfully created

Please have a look to the mkd command. It looks like Quanta+ is using /doc/Test/ when trying to create a new directory. If i use these commands on the remote server(FTP) of my ISP/Webhosting service i get this:

ftp&gt; size /doc/Test
 550 /doc/Test: No such file or directory.
ftp&gt; cd /doc
 250 CWD command successful. 
ftp&gt; mkdir /doc/Test/
 553 Could not determine cwdir: No such file or directory.


While using &apos;mkdir /doc/Test/&apos; on my lokal FTP seem to work my ISP does misunderstand this command. If i want to create a new directory on my ISP&apos;s FTP i have to use:

ftp&gt; mkdir /doc/Test
 257 MKD command successful.


A &apos;/&apos; at the end of the directory that should be created seem not to work on every FTP server.

Markus</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>506864</commentid>
    <comment_count>1</comment_count>
    <who name="András Manţia">amantia</who>
    <bug_when>2007-02-05 20:18:47 +0000</bug_when>
    <thetext>Can you create a new directory on that server with Konqueror using the 
ftp:// protocol?
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>506868</commentid>
    <comment_count>2</comment_count>
    <who name="Markus">darkvision</who>
    <bug_when>2007-02-05 20:27:13 +0000</bug_when>
    <thetext>Yes, that works without any problems.

Markus
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>506869</commentid>
    <comment_count>3</comment_count>
    <who name="Markus">darkvision</who>
    <bug_when>2007-02-05 20:35:17 +0000</bug_when>
    <thetext>I debugged this with my local server and Konqueror does not use a &apos;/&apos; at the end of the mkd command:

[DEBUG] 257 &quot;/&quot; is your current location
[DEBUG] Command [type] [I]
[DEBUG] 200 TYPE is now 8-bit binary
[DEBUG] Command [pasv] []
[DEBUG] 227 Entering Passive Mode (*******)
[DEBUG] Command [list] [-la]
[DEBUG] 150 Accepted data connection
[DEBUG] 226-ASCII
[DEBUG] 226-Options: -a -l 
[DEBUG] 226 2 matches total
[DEBUG] Command [mkd] [/Test]
[DEBUG] 257 &quot;/Test&quot; : The directory was successfully created
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>506892</commentid>
    <comment_count>4</comment_count>
    <who name="András Manţia">amantia</who>
    <bug_when>2007-02-05 21:11:44 +0000</bug_when>
    <thetext>Ok, this is new to me. Thanks for your help, I will fix the bug for the 
next version (3.5.7), but that won&apos;t appear soon. You will get a mail 
once it is fixed.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>507202</commentid>
    <comment_count>5</comment_count>
    <who name="András Manţia">amantia</who>
    <bug_when>2007-02-06 21:40:58 +0000</bug_when>
    <thetext>SVN commit 630937 by amantia:

Fix directory creation when certain ftp servers are used.

BUG: 141232

 M  +4 -2      lib/qextfileinfo.cpp  
 M  +5 -1      quanta/ChangeLog  
 M  +10 -10    quanta/quanta.kdevelop  
 M  +3 -1      quanta/utility/quantanetaccess.cpp  


--- branches/KDE/3.5/kdewebdev/lib/qextfileinfo.cpp #630936:630937
@@ -192,6 +192,7 @@
 {
   int i = 0;
   bool result;
+  KURL dir3; 
   KURL dir2;
   KURL dir1 = path;
   dir1.setPath(&quot;/&quot;);
@@ -211,8 +212,9 @@
       dir2 = cdUp(dir2);
     //  debug(d1);
     }
-  //  dir2.setPath(dir2.path(-1));
-    result = KIO::NetAccess::mkdir(dir2, window);
+    dir3 = dir2;
+    dir3.adjustPath(-1); //some servers refuse to create directories ending with a slash
+    result = KIO::NetAccess::mkdir(dir3, window);
     if (dir2.path() == &quot;/&quot; || !result)
       break;
     i++;
--- branches/KDE/3.5/kdewebdev/quanta/ChangeLog #630936:630937
@@ -1,7 +1,11 @@
 This files contains the changes since Quanta 2.0 until the current 3.5.x series.
 
-Version 3.5.6 (Release date: xx-xx-2006; Started 01-09-2006):
+Version 3.5.7 (Release date: xx-xx-2006; Started 06-02-2006)
  - bugfixes:
+      - fix directory creation when certain ftp servers are used [#141232]
+
+Version 3.5.6 (Release date: 26-01-2006; Started 12-10-2006):
+ - bugfixes:
       - show Find in Files menu if KFileReplace is installed [related to #132530]
       - fix various crashes in the debugger [#137483]
       - fix crash when editing a &lt;style&gt; CSS area
--- branches/KDE/3.5/kdewebdev/quanta/quanta.kdevelop #630936:630937
@@ -17,8 +17,8 @@
     &lt;projectdirectory&gt;.&lt;/projectdirectory&gt;
     &lt;absoluteprojectpath&gt;false&lt;/absoluteprojectpath&gt;
     &lt;secondaryLanguages/&gt;
-    &lt;versioncontrol&gt;&lt;/versioncontrol&gt;
-    &lt;defaultencoding&gt;&lt;/defaultencoding&gt;
+    &lt;versioncontrol/&gt;
+    &lt;defaultencoding/&gt;
     &lt;projectname&gt;quanta&lt;/projectname&gt;
   &lt;/general&gt;
   &lt;kdevautoproject&gt;
@@ -184,7 +184,7 @@
     &lt;/groups&gt;
     &lt;tree&gt;
       &lt;hidenonprojectfiles&gt;false&lt;/hidenonprojectfiles&gt;
-      &lt;hidepatterns/&gt;
+      &lt;hidepatterns&gt;&lt;/hidepatterns&gt;
       &lt;showvcsfields&gt;true&lt;/showvcsfields&gt;
     &lt;/tree&gt;
   &lt;/kdevfileview&gt;
@@ -207,16 +207,16 @@
   &lt;/kdevdoctreeview&gt;
   &lt;kdevdebugger&gt;
     &lt;general&gt;
-      &lt;dbgshell&gt;&lt;/dbgshell&gt;
+      &lt;dbgshell/&gt;
       &lt;programargs/&gt;
       &lt;gdbpath&gt;/usr/bin/gdb&lt;/gdbpath&gt;
       &lt;breakonloadinglibs&gt;true&lt;/breakonloadinglibs&gt;
       &lt;separatetty&gt;false&lt;/separatetty&gt;
       &lt;floatingtoolbar&gt;false&lt;/floatingtoolbar&gt;
       &lt;runappinappdirectory&gt;true&lt;/runappinappdirectory&gt;
-      &lt;configGdbScript&gt;&lt;/configGdbScript&gt;
-      &lt;runShellScript&gt;&lt;/runShellScript&gt;
-      &lt;runGdbScript&gt;&lt;/runGdbScript&gt;
+      &lt;configGdbScript/&gt;
+      &lt;runShellScript/&gt;
+      &lt;runGdbScript/&gt;
     &lt;/general&gt;
     &lt;display&gt;
       &lt;staticmembers&gt;false&lt;/staticmembers&gt;
@@ -259,10 +259,10 @@
   &lt;/kdevcvs&gt;
   &lt;kdevfilecreate&gt;
     &lt;filetypes&gt;
-      &lt;type icon=&quot;&quot; ext=&quot;h&quot; name=&quot;C++ header&quot; create=&quot;template&quot; &gt;
+      &lt;type icon=&quot;&quot; ext=&quot;h&quot; create=&quot;template&quot; name=&quot;C++ header&quot; &gt;
         &lt;descr&gt;Quanta speicfic header&lt;/descr&gt;
       &lt;/type&gt;
-      &lt;type icon=&quot;source_cpp&quot; ext=&quot;cpp&quot; name=&quot;C++ source&quot; create=&quot;template&quot; &gt;
+      &lt;type icon=&quot;source_cpp&quot; ext=&quot;cpp&quot; create=&quot;template&quot; name=&quot;C++ source&quot; &gt;
         &lt;descr&gt;A new empty C++ file.&lt;/descr&gt;
       &lt;/type&gt;
     &lt;/filetypes&gt;
@@ -298,7 +298,7 @@
     &lt;/codecompletion&gt;
     &lt;references/&gt;
     &lt;creategettersetter&gt;
-      &lt;prefixGet&gt;&lt;/prefixGet&gt;
+      &lt;prefixGet/&gt;
       &lt;prefixSet&gt;set&lt;/prefixSet&gt;
       &lt;prefixVariable&gt;m_,_&lt;/prefixVariable&gt;
       &lt;parameterName&gt;theValue&lt;/parameterName&gt;
--- branches/KDE/3.5/kdewebdev/quanta/utility/quantanetaccess.cpp #630936:630937
@@ -158,7 +158,9 @@
 
 bool QuantaNetAccess::mkdir( const KURL &amp; url, QWidget* window, int permissions, bool confirm )
 {
-  bool ok = KIO::NetAccess::mkdir( url, window, permissions );
+  KURL u = url;
+  u.adjustPath(-1); //some servers refuse to create directories ending with a slash
+  bool ok = KIO::NetAccess::mkdir( u, window, permissions );
   if (ok) {
     checkProjectInsert(url, window, confirm);
   } else {
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>507571</commentid>
    <comment_count>6</comment_count>
    <who name="Markus">darkvision</who>
    <bug_when>2007-02-08 05:55:20 +0000</bug_when>
    <thetext>Hi...

thanks for the patch. I applied it to Quanta 3.5.6 and tested upload of new directories. Seem to work.

Markus
</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>