Enlightenment CVS committal
Author : gilbertt
Project : misc
Module : camE
Dir : misc/camE
Modified Files:
AUTHORS example.camErc webcam.c
Log Message:
Patch from Abel Mui�o <[EMAIL PROTECTED]>
- optionally delete before rename when uploading via FTP
===================================================================
RCS file: /cvsroot/enlightenment/misc/camE/AUTHORS,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- AUTHORS 7 Feb 2003 12:33:06 -0000 1.8
+++ AUTHORS 10 Jun 2003 09:30:19 -0000 1.9
@@ -20,3 +20,6 @@
Birger Nissen <[EMAIL PROTECTED]>
archive subdirs
+
+Abel Mui�o <[EMAIL PROTECTED]>
+ optionally delete before move when uploading via FTP
===================================================================
RCS file: /cvsroot/enlightenment/misc/camE/example.camErc,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -3 -r1.23 -r1.24
--- example.camErc 15 Mar 2003 15:25:54 -0000 1.23
+++ example.camErc 10 Jun 2003 09:30:19 -0000 1.24
@@ -20,6 +20,9 @@
debug = 0
# Actually do the upload? If do = 0, just take and archive pics.
do = 1
+# Some servers require us to explicitly delete the previous image
+# In that case, enable this option
+delete_first = 0
# you can set ftp->do to 0 above and use scp instead - you still need
# the dir, file and tmp settings in the ftp section for this to work.
===================================================================
RCS file: /cvsroot/enlightenment/misc/camE/webcam.c,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -3 -r1.62 -r1.63
--- webcam.c 26 Mar 2003 08:54:12 -0000 1.62
+++ webcam.c 10 Jun 2003 09:30:19 -0000 1.63
@@ -37,7 +37,7 @@
#include "parseconfig.h"
#include "pwc-ioctl.h"
-#define VERSION "1.4"
+#define VERSION "1.5"
void log(char *fmt,
...);
@@ -54,6 +54,7 @@
int ftp_passive = 1;
int ftp_do = 1;
int ftp_keepalive = 1;
+int ftp_delete_first = 0;
char *scp_target = NULL;
char *grab_device = "/dev/video0";
char *grab_text = ""; /* strftime */
@@ -97,7 +98,7 @@
/* subdirs */
int archive_shot_every = 1; /* default to archive every shot */
char *archive_thumbnails_dir = NULL;
-int archive_thumbnails_create = 0; /* default is not to create archive thumbnails
*/
+int archive_thumbnails_create = 0; /* default is not to create archive thumbnails */
int archive_thumbnails_width = 120;
int archive_thumbnails_height = 90;
char *grab_blockfile = NULL;
@@ -918,6 +919,10 @@
fstat(fileno(infile), &st);
if (!post_commands) {
+ if (ftp_delete_first) {
+ snprintf(buf, sizeof(buf), "dele %s", remote);
+ post_commands = curl_slist_append(post_commands, buf);
+ }
snprintf(buf, sizeof(buf), "rnfr %s", tmp);
post_commands = curl_slist_append(post_commands, buf);
snprintf(buf, sizeof(buf), "rnto %s", remote);
@@ -1035,15 +1040,15 @@
fprintf(stderr, "Write error\n");
log("Write error\n");
break;
- case CURLE_MALFORMAT_USER: /* the user name is illegally specified */
+ case CURLE_MALFORMAT_USER: /* the user name is illegally specified */
fprintf(stderr, "Malformatted username\n");
log("Malformatted username\n");
break;
- case CURLE_FTP_COULDNT_STOR_FILE: /* failed FTP upload */
+ case CURLE_FTP_COULDNT_STOR_FILE: /* failed FTP upload */
fprintf(stderr, "Couldn't STOR the file\n");
log("Couldn't STOR the file\n");
break;
- case CURLE_READ_ERROR: /* could open/read from file */
+ case CURLE_READ_ERROR: /* could open/read from file */
fprintf(stderr, "Couldn't open temp file\n");
log("Couldn't open temp file\n");
break;
@@ -1051,11 +1056,11 @@
fprintf(stderr, "Out of memory\n");
log("Out of memory\n");
break;
- case CURLE_OPERATION_TIMEOUTED: /* the timeout time was reached */
+ case CURLE_OPERATION_TIMEOUTED: /* the timeout time was reached */
fprintf(stderr, "Upload timed out\n");
log("Upload timed out\n");
break;
- case CURLE_FTP_PORT_FAILED: /* FTP PORT operation failed */
+ case CURLE_FTP_PORT_FAILED: /* FTP PORT operation failed */
fprintf(stderr, "ftp PORT failed\n");
log("ftp PORT failed\n");
break;
@@ -1240,6 +1245,8 @@
ftp_timeout = i;
if (NULL != (val = cfg_get_str("ftp", "interface")))
ftp_interface = val;
+ if (-1 != (i = cfg_get_int("ftp", "delete_first")))
+ ftp_delete_first = i;
if (NULL != (val = cfg_get_str("scp", "target")))
scp_target = val;
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs