Re: sitecopy Digest, Vol 22, Issue 3

Joe Orton <[email protected]> Tue, 13 Mar 2012 09:47:39 +0000
Newsgroups gmane.comp.web.sitecopy
Message-ID <[email protected]>
On Tue, Mar 13, 2012 at 12:18:40PM +0800, Kees wrote:
> Both /Kees and /Kees/mysite exist, /Kees was always there and /mysite I
> created manually (if I manually create the directory tree .sitecopy
> works, but that is not very practical).
> 
> Have a look at this (unless sitecopy converts everything to lower (or
> upper) case, everything is there):

Can you try changing your rcfile entry to:

   remote ~/Kees/mysite

some FTP servers get confused by the absolute pathnames.

If that doesn't help, and you have built sitecopy from source, you could 
try this patch, which extends "usecwd" mode to MKD:

Index: src/ftp.c
===================================================================
--- src/ftp.c	(revision 1882)
+++ src/ftp.c	(working copy)
@@ -1,6 +1,6 @@
 /* 
    sitecopy, for managing remote web sites. Generic(ish) FTP routines.
-   Copyright (C) 1998-2005, Joe Orton <[email protected]>
+   Copyright (C) 1998-2005, 2009, 2012, Joe Orton <[email protected]>
                                                                      
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -135,6 +135,8 @@
 static int get_modtime(ftp_session *sess, const char *root,
 		       const char *filename);
 
+static int maybe_chdir(ftp_session *sess, const char **remotefile);
+
 /* Sets session error to system errno value 'errnum'. */
 static void set_syserr(ftp_session *sess, const char *error, int errnum)
 {
@@ -604,6 +606,12 @@
  * FTP state response */
 int ftp_mkdir(ftp_session *sess, const char *dir)
 {
+    int ret;
+
+    if ((ret = maybe_chdir(sess, &dir)) != FTP_OK) {
+        return ret;
+    }
+    
     return execute(sess, "MKD %s", dir);
 }