Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Converter deletes intermediate file (not temp WAV) (Read 2644 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Converter deletes intermediate file (not temp WAV)

This would be hard for me explaining but I'll try as simple as I can:

First I thought is lossyWAV thing, but then I realized it's foobar converter.
lossyWAV can produce two files (lossy part and correction part) and additional encoding requires using command shell (cmd.exe) so that it can be done with foobar converter:

converter example:
encoder: [font= "Lucida Console"]C:\windows\system32\cmd.exe[/font]
extension: [font= "Lucida Console"]lossy.tak[/font]
parameters:[font= "Lucida Console"] /d /c c:\"Program Files"\encoders\lw_tak.bat %s %d[/font]

lw_tak.bat
Code: [Select]
c:\"Program Files"\encoders\lossywav %1 --portable --correction --below --silent
c:\"Program Files"\encoders\takc -e -p2m -fsl512 -silent -overwrite -lp "%~n1.lossy.wav" "%~n2.tak"
c:\"Program Files"\encoders\takc -e -p2m -fsl512 -silent -overwrite -lp "%~n1.lwcdf.wav" "%~n2.lwcdf.tak"

Then I run this converter preset on this file: Filenäme.flac (notice a diaeresis)

foobar produces:
[font= "Lucida Console"]temp.wav[/font]

line 1 produces this files:
[font= "Lucida Console"]temp.lossy.wav
temp.lwcdf.wav[/font]


line 2 produces:
[font= "Lucida Console"]temp.lossy.tak[/font]

line 3 produces:
temp.lossy.lwcdf.tak

After converter finishes this files are left:
[font= "Lucida Console"]Filenäme.flac
temp.lossy.wav
temp.lwcdf.wav
Filenäme.lossy.tak[/font]

temp.lossy.lwcdf.tak failed in finishing as Filenäme.lossy.lwcdf.tak, and got deleted
This only happens if filename has accented characters i.e. if it's not in the code page I use
Using cmd.exe /u doesn't help

I noticed this, while mass converting, and luckily for me I spotted it before I deleted source files, although I've set media library to exclude lwcdf.tak files

I know this usage and naming schemes are hard to follow, but the point is that converter deletes intermediate product, which is not it WAV and this happens only with unicode filenames

Converter deletes intermediate file (not temp WAV)

Reply #1
As you've expected, I don't fully understand what's the problem. But I'll try. Note that I don't really know how the Converter really works anyway.

For filenames with basic ASCII characters only, it executes the encoder with the destination filename being the real final output filename, because that's always safe. Your batch file will create <output>.lossy.tak, which will be recognized by the Converter upon finishing, tagged and finalized, and <output>.lossy.lwcdf.tak, which will just be left laying in the folder unnoticed.

For filenames with extended characters, a workaround for broken encoders which don't support Unicode is used - both the input and output filenames will be temp.<ext>. Now your batch file will create temp.lossy.tak and temp.lossy.lwcdf.tak, but the Converter will see only temp.lossy.tak afterwards, as that's what's set in the encoder preset. Apparently all the temporary stuff is cleaned by a mask afterwards, but even if it wasn't and your extra file would be left there, it wouldn't be renamed to your liking.
Full-quoting makes you scroll past the same junk over and over.

Converter deletes intermediate file (not temp WAV)

Reply #2
I hate this kind of usage too, so thanks your replying 

Your batch file will create <output>.lossy.tak, which will be recognized by the Converter upon finishing, tagged and finalized, and <output>.lossy.lwcdf.tak, which will just be left laying in the folder unnoticed.

That's correct. If input filename name is: Filename.flac (totally valid characters) everything is fine, and this is produced (without me cleaning of course ):
[font= "Lucida Console"]Filename.flac
temp.lossy.wav
temp.lwcdf.wav
Filename.lossy.tak
Filename.lossy.lwcdf.tak[/font]


Where [font= "Lucida Console"]Filename.lossy.lwcdf.tak[/font] got correctly renamed, but without tagging applied as you noted

For filenames with extended characters, a workaround for broken encoders which don't support Unicode is used

So, there is the cause of this behaviour. Thanks