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: Is It Possible To Use "--output-prefix" With An Absolute Path? (Read 257 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Is It Possible To Use "--output-prefix" With An Absolute Path?

I can compress a wav file using an absolute path:

flac /data/all/temp/a/1.wav

If I try to put the output file in a different directory it throws an error:

flac --output-prefix=/data/all/temp/b/ /data/all/temp/a/1.wav

However, if I don't use an absolute path for the input file it does work:

cd /data/all/temp/a/
flac --output-prefix=/data/all/temp/b/ 1.wav

Here's the error:
Quote
1.wav: ERROR initializing encoder
       init_status = FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR
       state = FLAC__STREAM_ENCODER_IO_ERROR

An error occurred opening the output file; it is likely that the output
directory does not exist or is not writable, the output file already exists and
is not writable, or the disk is full.

Is that just something that's not supposed to work or have I made a mistake?

Re: Is It Possible To Use "--output-prefix" With An Absolute Path?

Reply #1
In your example flac will try to write to

/data/all/temp/b//data/all/temp/a/1.wav

and it will fail because directory

/data/all/temp/b/data/all/temp/a

probably doesn't exist. In other words, flac doesn't strip the directory part from inputs before concatenating them with output prefix.

Re: Is It Possible To Use "--output-prefix" With An Absolute Path?

Reply #2
Ah, thanks very much! I'll just "cd" into the right directory each time then. Glad it's not me going crazy :-)