| 13 | I am using VFS (extfs). I have written program (backup extractor) |
| 14 | which handle "copyout" and "list" commands from mc. But if I want to |
| 15 | copyout a whole directory (or a lot of files from archive), it is |
| 16 | called FOR EACH extracted file. In my case, extractor (duplicity |
| 17 | backupper, http://www.nongnu.org/duplicity/ ) starts very long time. |
| 18 | But it can extract whole directory quickly. |
| 19 | |
| 20 | I think if mc would pass to extfs script environment variable |
| 21 | containing names of ALL the selected files (AND DIRECTORIES) on the |
| 22 | panel before extracting, it would get ability to optimize extract |
| 23 | script. For example, I can fully extract all needed files in |
| 24 | temporary directory by ONE call to duplicity, and then just copy |
| 25 | these files from temp directory to pathes needed by mc. |
| 26 | }}} |
| 27 | |
| 28 | Comment 1 by Anonymous at Sat 13 Mar 2004 12:19:29 AM UTC: |
| 29 | {{{ |
| 30 | Here is a simple patch (also attached). Hope you will apply it in |
| 31 | next release. |
| 32 | |
| 33 | --- mc-4.6.1-pre1/src/file.c 2003-10-27 20:36:19.000000000 +0300 |
| 34 | +++ mc-4.6.1-pre1.patched/src/file.c 2004-03-12 03:13:05.000000000 +0300 |
| 35 | @@ -1865,4 +1865,27 @@ |
| 36 | } |
| 37 | } |
| 38 | + |
| 39 | + /* |
| 40 | + * Dmitry Koteroff <d[at]koteroff.ru> |
| 41 | + * Patch to save selected items in environment variable. |
| 42 | + * This variable would be passed to extfs scripts and may be used |
| 43 | + * to optimize depacking performance. |
| 44 | + */ |
| 45 | + {{{{ |
| 46 | + char* env = g_strconcat("", NULL); |
| 47 | + for (i = 0; i < panel->count; i++) { |
| 48 | + char prevEnv, p; |
| 49 | + if (!panel->dir.list[i].f.marked) continue; |
| 50 | + p = concat_dir_and_file (panel->cwd, panel->dir.list[i].fname); |
| 51 | + prevEnv = env; |
| 52 | + env = g_strconcat(prevEnv, p, "\n", NULL); |
| 53 | + g_free(p); |
| 54 | + g_free(prevEnv); |
| 55 | + } |
| 56 | + setenv("MC_SELECTION", env, 1); |
| 57 | + g_free(env); |
| 58 | + }}}} |
| 59 | + |
| 60 | + |
| 61 | #ifdef WITH_BACKGROUND |
| 62 | /* Did the user select to do a background operation? */ |
| 63 | }}} |
| 64 | |
| 65 | Comment 2 by Anonymous at Sat 13 Mar 2004 06:40:31 PM UTC: |
| 66 | {{{ |
62 | | Anonymous |
63 | | Sat 13 Mar 2004 12:19:29 AM UTC, comment #1: |
64 | | |
65 | | Here is a simple patch (also attached). Hope you will apply it in |
66 | | next release. |
67 | | |
68 | | --- mc-4.6.1-pre1/src/file.c 2003-10-27 20:36:19.000000000 +0300 |
69 | | +++ mc-4.6.1-pre1.patched/src/file.c 2004-03-12 03:13:05.000000000 +0300 |
70 | | @@ -1865,4 +1865,27 @@ |
71 | | } |
72 | | } |
73 | | + |
74 | | + /* |
75 | | + * Dmitry Koteroff <d[at]koteroff.ru> |
76 | | + * Patch to save selected items in environment variable. |
77 | | + * This variable would be passed to extfs scripts and may be used |
78 | | + * to optimize depacking performance. |
79 | | + */ |
80 | | + {{{{ |
81 | | + char* env = g_strconcat("", NULL); |
82 | | + for (i = 0; i < panel->count; i++) { |
83 | | + char prevEnv, p; |
84 | | + if (!panel->dir.list[i].f.marked) continue; |
85 | | + p = concat_dir_and_file (panel->cwd, panel->dir.list[i].fname); |
86 | | + prevEnv = env; |
87 | | + env = g_strconcat(prevEnv, p, "\n", NULL); |
88 | | + g_free(p); |
89 | | + g_free(prevEnv); |
90 | | + } |
91 | | + setenv("MC_SELECTION", env, 1); |
92 | | + g_free(env); |
93 | | + }}}} |
94 | | + |
95 | | + |
96 | | #ifdef WITH_BACKGROUND |
97 | | /* Did the user select to do a background operation? */ |
98 | | Anonymous |
99 | | Fri 12 Mar 2004 11:00:45 PM UTC, original submission: |
100 | | |
101 | | Not a bug, but feature request. |
102 | | |
103 | | I am using VFS (extfs). I have written program (backup extractor) |
104 | | which handle "copyout" and "list" commands from mc. But if I want to |
105 | | copyout a whole directory (or a lot of files from archive), it is |
106 | | called FOR EACH extracted file. In my case, extractor (duplicity |
107 | | backupper, http://www.nongnu.org/duplicity/ ) starts very long time. |
108 | | But it can extract whole directory quickly. |
109 | | |
110 | | I think if mc would pass to extfs script environment variable |
111 | | containing names of ALL the selected files (AND DIRECTORIES) on the |
112 | | panel before extracting, it would get ability to optimize extract |
113 | | script. For example, I can fully extract all needed files in |
114 | | temporary directory by ONE call to duplicity, and then just copy |
115 | | these files from temp directory to pathes needed by mc. |