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 =
"FLAC__METADATA_CHAIN_STATUS_ERROR_OPENING_FILE"
$ 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
/cdrom/kyuss1995-02-21t01.flac
$ 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
9969d1d2e479db9952b6e4c34b85288b
ERROR: writing FLAC file kyuss1995-02-21t01.flac, error
= FLAC__METADATA_CHAIN_STATUS_ERROR_OPENING_FILE
$ ls -al kyuss1995-02-21t01.flac
-r--r--r-- 1 paul wheel 11150670 Sep 9 11:43
kyuss1995-02-21t01.flac
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
respectively.
I've not looked at the source code, so I can't suggest
a fix or workaround.
Cheers,
Paul.
Josh Coalson
2002-09-09
Josh Coalson
2002-09-09
Josh Coalson
2002-09-09
Logged In: YES
user_id=78173
Fixed in CVS. do_shorthand_operations_on_file() was not checking the 'needs_write' flag.
Josh