1
/* -*- Mode: Vala; indent-tabs-mode: nil; tab-width: 2 -*- */
3
This file is part of Déjà Dup.
4
For copyright information, see AUTHORS.
6
Déjà Dup is free software: you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation, either version 3 of the License, or
9
(at your option) any later version.
11
Déjà Dup is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
16
You should have received a copy of the GNU General Public License
17
along with Déjà Dup. If not, see <http://www.gnu.org/licenses/>.
24
internal class RecursiveDelete : RecursiveOp
26
public RecursiveDelete(File source)
31
protected override void handle_file()
37
raise_error(src, dst, e.message);
41
protected override void finish_dir()
44
src.@delete(null); // will only be deleted if empty, so we won't
45
// accidentally toss files left over from a failed
49
// Ignore. It's in /tmp, so it'll disappear, and most likely is just
50
// a non-empty directory.
54
protected override RecursiveOp clone_for_info(FileInfo info)
56
var child_name = info.get_name();
57
var src_child = src.get_child(child_name);
58
return new RecursiveDelete(src_child);