trying this on OSX and going across to a network file src and dest, there is an error code 65280, unable to init the temp file. After some debugging sessions myself and googling around the net, I was able to figure out the solution, its a one line fix. At line 701, where you call the system($convert_command), insert a line before that to remove the tempfile before calling flac and lame:
unlink $tmpfilename
$exit_value = system($convert_command);
It seems the temp file creation system in perl hangs on to some open status of that temp file when created such that when you call the system() call, any forked process with lame being called is unable to init that file. its possible that on some OS, the version of lame or whatever, it might work. But I can confirm your script does not work on OSX, particularly when the tempfile is on a network file share. In any case, at this point in the script there is nothing in the file, there is no harm to remove it and let lame recreate it again. The perl temp file mechanism still works to clean it up later.
trying this on OSX and going across to a network file src and dest, there is an error code 65280, unable to init the temp file. After some debugging sessions myself and googling around the net, I was able to figure out the solution, its a one line fix. At line 701, where you call the system($convert_command), insert a line before that to remove the tempfile before calling flac and lame:
It seems the temp file creation system in perl hangs on to some open status of that temp file when created such that when you call the system() call, any forked process with lame being called is unable to init that file. its possible that on some OS, the version of lame or whatever, it might work. But I can confirm your script does not work on OSX, particularly when the tempfile is on a network file share. In any case, at this point in the script there is nothing in the file, there is no harm to remove it and let lame recreate it again. The perl temp file mechanism still works to clean it up later.