feature request: delete after copy

Andrew V. Samoilov kai at cmail.ru
Wed Jan 30 11:13:51 UTC 2002


Hello!

On Sun, Dec 09, 2001 at 10:20:15AM +0100, Klaus Ridder wrote:
> I have the following problem with mc
> 
> I have to move a lot of data to a filesystem which is remotely mounted by
> smb through a ssh tunnel.
> The problem is, that I cannot chown, so I am not able to use the "move"
> command of midnight commander, but "copy" insted (with switching off
> "preserve attributes".
> However, one copy session can take some hours or even days, and it would be
> great if mc really could remove sigle files as soon as they are transfered
> (as move does).
> 
> So I suggest to either
> - implement the option "preserve attributes" also to the mv option
> - implement an option "delete each file after successfully copied" to the
> copy dialogue.
> 
> It would be one of thos could be implemented.
> Is there probably a workaround for me at the current time?
> 

Can you test patch below?

Regards,
Andrew.

ChangeLog:
* filegui.c (file_mask_dialog): Enable "preserve Attributes"
and "follow Links" features in Move dialog.

Index: filegui.c
===================================================================
RCS file: /cvs/gnome/mc/src/filegui.c,v
retrieving revision 1.21
diff -u -p -u -p -r1.21 filegui.c
--- filegui.c	2002/01/21 20:47:06	1.21
+++ filegui.c	2002/01/30 10:59:28
@@ -906,11 +908,10 @@ file_mask_dialog (FileOpContext *ctx, Fi
 
     if (operation == OP_COPY) {
 	Quick_input.class = "quick_file_mask_copy";
-	Quick_input.widgets = fmd_widgets;
     } else { /* operation == OP_MOVE */
 	Quick_input.class = "quick_file_mask_move";
-	Quick_input.widgets = fmd_widgets + 2;
     }
+    Quick_input.widgets = fmd_widgets;
     fmd_widgets [FMDI0].text = text;
     fmd_widgets [FMDI2].text = def_text;
     fmd_widgets [FMDI2].str_result = &dest_dir;
@@ -922,12 +923,12 @@ ask_file_mask:
     if ((val = quick_dialog_skip (&Quick_input, SKIP)) == B_CANCEL)
 	return 0;
 
-    if (ctx->follow_links && operation != OP_MOVE)
+    if (ctx->follow_links)
 	ctx->stat_func = (mc_stat_fn) mc_stat;
     else
 	ctx->stat_func = (mc_stat_fn) mc_lstat;
 
-    if (ctx->op_preserve || operation == OP_MOVE) {
+    if (ctx->op_preserve) {
 	ctx->preserve = 1;
 	ctx->umask_kill = 0777777;
 	ctx->preserve_uidgid = (geteuid () == 0) ? 1 : 0;



More information about the mc-devel mailing list