locking geintroduceerd
This commit is contained in:
parent
00e82e9bb6
commit
b0b7aeeebb
1 changed files with 11 additions and 0 deletions
|
|
@ -31,6 +31,15 @@ foreach (@source) {
|
|||
}
|
||||
close ($target);
|
||||
|
||||
if ( -e ".mv_wrap") {
|
||||
die "Another mv_wrap process is active in this direcory\n"
|
||||
}
|
||||
else {
|
||||
open LOCK, ">.mv_wrap";
|
||||
print LOCK $$;
|
||||
close LOCK;
|
||||
}
|
||||
|
||||
&edit($target_name);
|
||||
|
||||
open $target, $target_name or die "Couldn't open tempfile: $target_name: $!";
|
||||
|
|
@ -54,6 +63,8 @@ if (@unsafe = &check_safety(\@source, \@target)) {
|
|||
# final move
|
||||
&move_files(\@source, \@target);
|
||||
|
||||
unlink ".mv_wrap" or die "Couldn't remove lock";
|
||||
|
||||
# call EDITOR or vi with filename
|
||||
# edit($filename);
|
||||
sub edit {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue