I fully agree with Michael that this is a severe bug as I have lost many hours of editing myself. Unfortunately I don't see any progress on this bug for almost 3 years. Let's try to change that! :-)
Last night I patched vidir to circumvent the problem of lost changes and renamed it to vidir-safe. Of course, I'd prefer to see these (simple changes) integrated into vidir. Let me know if you need any more help with it. Thanks a lot, Andy
*** vidir 2016-05-10 13:46:53.477022984 +0200 --- vidir-safe 2016-05-10 13:46:42.053180092 +0200 *************** *** 2,20 **** =head1 NAME ! vidir - edit directory =head1 SYNOPSIS ! B<vidir> [--verbose] [directory|file|-] ... =head1 DESCRIPTION ! vidir allows editing of the contents of a directory in a text editor. If no directory is specified, the current directory is edited. When editing a directory, each item in the directory will appear on its own ! numbered line. These numbers are how vidir keeps track of what items are changed. Delete lines to remove files from the directory, or edit filenames to rename files. You can also switch pairs of numbers to swap filenames. --- 2,23 ---- =head1 NAME ! vidir-safe - edit directory =head1 SYNOPSIS ! B<vidir-safe> [--verbose] [directory|file|-] ... =head1 DESCRIPTION ! vidir-safe is like vidir but does NOT delete the TMP file in case of ! errors while renaming, thus preserves your valuable work. ! ! vidir-safe allows editing of the contents of a directory in a text editor. If no directory is specified, the current directory is edited. When editing a directory, each item in the directory will appear on its own ! numbered line. These numbers are how vidir-safe keeps track of what items are changed. Delete lines to remove files from the directory, or edit filenames to rename files. You can also switch pairs of numbers to swap filenames. *************** *** 37,54 **** =over 4 ! =item vidir ! =item vidir *.jpeg Typical uses. ! =item find | vidir - Edit subdirectory contents too. To delete subdirectories, delete all their contents and the subdirectory itself in the editor. ! =item find -type f | vidir - Edit all files under the current directory and subdirectories. --- 40,57 ---- =over 4 ! =item vidir-safe ! =item vidir-safe *.jpeg Typical uses. ! =item find | vidir-safe - Edit subdirectory contents too. To delete subdirectories, delete all their contents and the subdirectory itself in the editor. ! =item find -type f | vidir-safe - Edit all files under the current directory and subdirectories. *************** *** 82,87 **** --- 85,92 ---- use File::Temp; use Getopt::Long; + $File::Temp::KEEP_ALL = 1; # this is the safe part of vidir-safe + my $error=0; my $verbose=0; *************** *** 217,222 **** --- 222,237 ---- close IN || die "$0: cannot read ".$tmp->filename.": $!\n"; unlink($tmp.'~') if -e $tmp.'~'; + # keep temporary file in case of errors while renaming + if ($error) + { + print "There was an error: your filename changes are here:", $tmp->filename, "\n"; + } + else + { + unlink($tmp->filename); + } + sub rm { my $file = shift;