SYNOPSIS
- pytagsfs [OPTIONS] {sourcedir} {mountpoint}
DESCRIPTION
To get a feel for what's possible, see the section called "EXAMPLES".
Log messages are kept in a limited-size ring buffer in memory, and can be read from the virtual file named ".log", under the mount point root.
OPTIONS
--version
- show version of program and exit
-h, --help
- show summary of options and exit
-f
- foreground operation
-d
- enable debug output (implies -f)
-s
- disable multi-threaded operation
-r
- mount read-only
-o opt[,opt...]
- mount options
-o format=FORMAT
- format string for destination paths (see the section called "FORMAT STRINGS")
-o srcfilter=EXPR
- adds a source path filter; may be specified more than once (see the section called "PATH FILTERS")
-o dstfilter=EXPR
- adds a destination path filter; may be specified more than once (see the section called "PATH FILTERS")
-o iocharset=ENCODING
- mounted tree character encoding (default utf-8)
-o source_iocharset=ENCODING
- source directory character encoding (default utf-8)
-o ro
- synonym for -r (Linux)
-o rdonly
- synonym for -r (Darwin, FreeBSD, NetBSD, OpenBSD)
-o allow_other
- allow access to other users
-o allow_root
- allow access to root
-o nonempty
- allow mounts over non-empty file/dir
-o uid=UID
- set file owner
-o gid=GID
- set file group
-o verbosity=VERBOSITY
- log level; must be one of "debug", "info", "warning", "error", "critical"; defaults to "warning"
-o logsize=LOGSIZE
- length of log file ring buffer
-o debug
- synonym for -d
-o force_write_support
- Force write support on systems that are not known to have correct mmap semantics. This option is dangerous and can lead to file corruption with some applications on some systems!
FORMAT STRINGS
A format string must be specified for each pytagsfs mount. The format string specifies the structure of the virtual filesystem mount by defining a template for virtual paths. For instance, the following format string defines a virtual filesystem layout that organizes media files by artist, then by album, and, finally, by track name:
-
/%{artist}/%{album}/%{track}.%{extension}
Substitutions
The format string should contain zero or more substitution sequences. Each such sequence begins with a percent sign (%).
Substitution sequences may be specified in either long or short forms. Long-form substitution sequences are written as "%{KEY}", where KEY corresponds with a meta-data key. The set of available keys varies from file to file, however, many media files feature some or all of the following long keys:
- filename name of the original file
- parent name of the original file's parent directory
- extension extension of the original file
- tracknumber track number; concise (like 7)
- TRACKNUMBER track number; two digits with leading zeros (like 07)
- artist artist
- composer composer
- title track title
- album album title
- year year of release
- genre genre
Short-form substitution sequences are written as "%X". Each such sequence is an abbreviation for a long-form sequence, as indicated below:
- f filename
- p parent
- e extension
- n number
- N NUMBER
- a artist
- c composer
- t title
- l album
- y year
- g genre
Modifiers
Format strings can be further extended to perform string translations on parameters prior to substitution. Such translations are indicated by the inclusion of a modifier character after the percent sign. For instance, "%^a" indicates an all-caps version of the artist name, as does "%^{artist}".
The full list of modifier characters follows:
- ^ UPPERCASE
- _ lowercase
- ! Title Case
Conditional Expressions
Normally, any file for which a parameter required by the format string cannot be determined is implicitly excluded from the resulting filesystem. Conditionals can be used to express that these files should be included, but that those portions of the format string that cannot be rendered should be omitted or replaced.
Two types of conditional expressions may be used: "if" expressions and "if-else" expressions. The contents of an "if" expression are omitted unless all parameters within that expressions can be successfully evaluated. An "if-else" expression is similar, except that, if the expression does not evaluate, an alternative will be used instead. Use the following syntax:
- %?expr%?
- %?expr%:alt%?
PATH FILTERS
Path filters can be used to limit the set of files presented by the filesystem using regular expressions. Files are filtered by source path or by destination path, inclusively (limiting the set of paths to those that match the regular expression) or exclusively (limiting the set of paths to those that do not match the regular expression).
Use the mount options srcfilter and dstfilter to filter by source path and destination path, respectively. Filters are inclusive unless the filter parameter starts with an exclamation point, in which case the regular expression is assumed to be the part of the parameter following the exclamation point.
Multiple filters of any kind may be used, and are applied in the order that they are specified on the command line. See the section called "EXAMPLES" for some sample filters.
EXAMPLES
View media files in src, with original filenames in a flat directory structure:
-
$ pytagsfs -o format='/%f' src mnt
View media files in src by album on mnt:
-
$ pytagsfs -o format='/%a/%f' src mnt
A more complex album-based view:
-
$ pytagsfs -o format='/%a - %l/%N %a - %t [%l].%e'
This is like above, but filters the result. I use this to display my files by album, but exclude compilations (which I've tagged to include a hyphen in the album name, like "various - album"):
-
$ pytagsfs -o \ format='/%a - %l/%N %a - %t [%l].%e',\ dstfilter='!^/[^/]* - [^/]* - [^/]*/' \ src albums
I use this to display the compilations:
-
$ pytagsfs -o \ format='/%l/%N %a - %t [%l].%e',\ dstfilter='^/[^/]* - [^/]*/' \ src compilations
Maybe you only want to see files that start with "a" and end in ".mp3"?
-
$ pytagsfs -o \ format='/%f',dstfilter='^/a',dstfilter='\.mp3$' \ src mnt
UNMOUNTING
To unmount the filesystem on Linux use fusermount(1):
-
$ fusermount -u mnt
To unmount the filesystem on OS X or *BSD use umount(1):
-
$ umount mnt
BUGS
Please report bugs on launchpad at http://launchpad.net/products/pytagsfs/+bugs.
AUTHOR
Forest Bond
- Author.
COPYRIGHT
Copyright © 2007, 2008, 2009