It seems that metaflac tries to write, even when
read-only operations such as "--show-md5sum" and
"--show-vc-field" are specified. If the user issuing
the metaflac command does not have write permission to
the files (directories?) specified on the command line,
then errors will be output. It also seems that if the
files are on a read-only filesystem, no output is
produced by metaflac, even when the files are readable.
$ metaflac --show-md5sum /cdrom/kyuss1995-02-21t01.flac
ERROR: reading metadata, status =
$ ls -ald /cdrom
dr-xr-xr-x 1 root wheel 2048 Sep 7 16:59 /cdrom
$ ls -al /cdrom/kyuss1995-02-21t01.flac
-r-xr-xr-x 1 root wheel 11150670 Sep 7 16:50
$ mount | grep cdrom
/dev/cd0c on /cdrom type cd9660 (read-only, local)
$ sum /cdrom/kyuss1995-02-21t01.flac
3042 10890 /cdrom/kyuss1995-02-21t01.flac
Note that when the command is run on a read-only file
on a filesystem mounted rw, output will be produced,
along with an error, as metaflac attempts to open the
file for writing:
$ ls -lad .
dr-xr-xr-x 2 paul wheel 512 Sep 9 11:43 .
$ metaflac --show-md5sum kyuss1995-02-21t01.flac
ERROR: writing FLAC file kyuss1995-02-21t01.flac, error
$ ls -al kyuss1995-02-21t01.flac
-r--r--r-- 1 paul wheel 11150670 Sep 9 11:43
This is using metaflac 1.0.3 both on NetBSD 1.6-current
and FreeBSD 4.6-STABLE, both built from the ports in
/usr/pkgsrc/audio/flac and /usr/ports/audio/flac
I've not looked at the source code, so I can't suggest
a fix or workaround.