use a safe function to rename a file

This commit is contained in:
Jamie Cameron
2023-07-13 19:48:51 -07:00
parent eb79f4c169
commit 3c21733d57

View File

@@ -56,7 +56,7 @@ if (!@index) {
push(@index, $bak) if (-r "$dir/$bak");
}
push(@index, "$in{'wav_filename'}.rmd");
system("mv $rmdfile $dir/$in{'wav_filename'}.rmd");
&rename_file($rmdfile, "$dir/$in{'wav_filename'}.rmd");
&open_lock_tempfile(INDEX, ">$index");
&print_tempfile(INDEX, map { "$_\n" } @index);
&close_tempfile(INDEX);