bephillips;444003 Wrote: 
> ... I see that both of the files below have backwards apostrophes in the
> file name. Could this be the problem? Thanks in advance for any help. 

yes, that's exactly what the problem is.

In the flac2mp3 script, just above this code:


Code:
--------------------
    
  $::Options{debug} && msg("$convert_command\n");
  
  # Convert the file
  my $exit_value = system($convert_command);
  
--------------------


the $convert_command is created, surrounding the $quotedsrc variable
that will be ultimately passed to the system() function (shown above):


Code:
--------------------
    
  my $convert_command =
  "$flaccmd @flacargs \"$quotedsrc\""
  . "| $lamecmd @lameargs - \"$quoteddest\"";
  
--------------------


This is trying to protect the command and arguments from the shell,
which will interpret metacharacters unless quoted.  Unfortunately,
double quotes do not protect backquotes, which is what you have in your
file name.  Thus, the shell keeps reading until it runs of out stuff to
read, never finding that closing backquote (aka backtick).

if you were to replace the backslashed double quotes from above, with
single quotes, as shown here in the script:


Code:
--------------------
    
  my $convert_command =
  "$flaccmd @flacargs '$quotedsrc'"
  . "| $lamecmd @lameargs - '$quoteddest'";
  
--------------------


the script would then blowup on file names that contained any single
quote.

So, the correct thing is to properly escape any backquotes in the
variable quotedsrc, and then those.

Adding the line below before should do the trick:


Code:
--------------------
    
  $quotedsrc =~ s/`/\\`/g;
  
  my $convert_command =
  "$flaccmd @flacargs \"$quotedsrc\""
  . "| $lamecmd @lameargs - \"$quoteddest\"";
  
--------------------


-- 
MrC
------------------------------------------------------------------------
MrC's Profile: http://forums.slimdevices.com/member.php?userid=468
View this thread: http://forums.slimdevices.com/showthread.php?t=14697

_______________________________________________
ripping mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/ripping

Reply via email to