2 Various non-library utilities
4 Copyright (C) 2003, 2004, 2005, 2006, 2007, 2011
5 The Free Software Foundation, Inc.
10 This file is part of the Midnight Commander.
12 The Midnight Commander is free software: you can redistribute it
13 and/or modify it under the terms of the GNU General Public License as
14 published by the Free Software Foundation, either version 3 of the License,
15 or (at your option) any later version.
17 The Midnight Commander is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program. If not, see <http://www.gnu.org/licenses/>.
28 #include "lib/global.h"
31 #include "src/filemanager/file.h"
32 #include "src/filemanager/filegui.h"
36 /*** global variables ****************************************************************************/
38 /*** file scope macro definitions ****************************************************************/
40 /*** file scope type declarations ****************************************************************/
42 /*** file scope variables ************************************************************************/
44 /*** file scope functions ************************************************************************/
45 /* --------------------------------------------------------------------------------------------- */
47 /* --------------------------------------------------------------------------------------------- */
48 /*** public functions ****************************************************************************/
49 /* --------------------------------------------------------------------------------------------- */
52 check_for_default (const vfs_path_t
* default_file_vpath
, const vfs_path_t
* file_vpath
)
56 file
= vfs_path_to_str (file_vpath
);
58 if (!exist_file (file
))
62 FileOpTotalContext
*tctx
;
64 default_file
= vfs_path_to_str (default_file_vpath
);
65 if (!exist_file (default_file
))
68 g_free (default_file
);
72 ctx
= file_op_context_new (OP_COPY
);
73 tctx
= file_op_total_context_new ();
74 file_op_context_create_ui (ctx
, 0, FALSE
);
75 copy_file_file (tctx
, ctx
, default_file
, file
);
76 file_op_total_context_destroy (tctx
);
77 file_op_context_destroy (ctx
);
78 g_free (default_file
);
86 /* --------------------------------------------------------------------------------------------- */