1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!ENTITY pytagsfs "<command>pytagsfs</command>">
]>
<refentry>
<refentryinfo>
<author><firstname>Forest</firstname><surname>Bond</surname></author>
<address>forest@alittletooquiet.net</address>
<copyright>
<year>2007</year>
<year>2008</year>
<year>2009</year>
</copyright>
<date>2009-12-14</date>
</refentryinfo>
<refmeta>
<refentrytitle>pytagsfs</refentrytitle>
<manvolnum>1</manvolnum>
</refmeta>
<refnamediv>
<refname>pytagsfs</refname>
<refpurpose>
filesystem mapping media files to an arbitrary directory structure
</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
&pytagsfs;
<group choice="opt">OPTIONS</group>
<arg choice="req"><replaceable>sourcedir</replaceable></arg>
<arg choice="req"><replaceable>mountpoint</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>
pytagsfs is a FUSE filesystem that was designed to present multiple views
of tagged media files. For instance, a directory tree containing audio
files could be mapped to a new directory structure organizing those same
files by album, genre, release date, etc.
</para>
<para>
To get a feel for what's possible, see
<xref linkend="refsect1_examples"/>.
</para>
<para>
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.
</para>
</refsect1>
<refsect1>
<title>Options</title>
<variablelist>
<varlistentry>
<term><option>--version</option></term>
<listitem><para>show version of program and exit</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-h</option>, <option>--help</option></term>
<listitem><para>show summary of options and exit</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-f</option></term>
<listitem><para>foreground operation</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-d</option></term>
<listitem><para>enable debug output (implies -f)</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-s</option></term>
<listitem><para>disable multi-threaded operation</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-r</option></term>
<listitem><para>mount read-only</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-o</option> opt[,opt...]</term>
<listitem><para>mount options</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-o</option> format=FORMAT</term>
<listitem>
<para>
format string for destination paths
(see <xref linkend="refsect1_format_strings"/>)
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-o</option> srcfilter=EXPR</term>
<listitem>
<para>
adds a source path filter; may be specified more than once
(see <xref linkend="refsect1_path_filters"/>)
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-o</option> dstfilter=EXPR</term>
<listitem>
<para>
adds a destination path filter; may be specified more than once
(see <xref linkend="refsect1_path_filters"/>)
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-o</option> iocharset=ENCODING</term>
<listitem>
<para>mounted tree character encoding (default utf-8)</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-o</option> source_iocharset=ENCODING</term>
<listitem>
<para>source directory character encoding (default utf-8)</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-o</option> ro</term>
<listitem>
<para>synonym for -r (Linux)</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-o</option> rdonly</term>
<listitem>
<para>synonym for -r (Darwin, FreeBSD, NetBSD, OpenBSD)</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-o</option> allow_other</term>
<listitem><para>allow access to other users</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-o</option> allow_root</term>
<listitem><para>allow access to root</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-o</option> nonempty</term>
<listitem><para>allow mounts over non-empty file/dir</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-o</option> uid=UID</term>
<listitem><para>set file owner</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-o</option> gid=GID</term>
<listitem><para>set file group</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-o</option> verbosity=VERBOSITY</term>
<listitem>
<para>
log level; must be one of "debug", "info", "warning", "error",
"critical"; defaults to "warning"
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-o</option> logsize=LOGSIZE</term>
<listitem>
<para>length of log file ring buffer</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-o</option> debug</term>
<listitem><para>synonym for -d</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-o</option> force_write_support</term>
<listitem><para>
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!
</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="refsect1_format_strings">
<title>Format Strings</title>
<para>
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:
</para>
<screen>/%{artist}/%{album}/%{track}.%{extension}</screen>
<refsect2>
<title>Substitutions</title>
<para>
The format string should contain zero or more substitution sequences.
Each such sequence begins with a percent sign (%).
</para>
<para>
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:
</para>
<simplelist>
<member><constant>filename</constant> name of the original file</member>
<member><constant>parent</constant> name of the original file's parent directory</member>
<member><constant>extension</constant> extension of the original file</member>
<member><constant>tracknumber</constant> track number; concise (like 7)</member>
<member><constant>TRACKNUMBER</constant> track number; two digits with leading zeros (like 07)</member>
<member><constant>artist</constant> artist</member>
<member><constant>composer</constant> composer</member>
<member><constant>title</constant> track title</member>
<member><constant>album</constant> album title</member>
<member><constant>year</constant> year of release</member>
<member><constant>genre</constant> genre</member>
</simplelist>
<para>
Short-form substitution sequences are written as "%X". Each such
sequence is an abbreviation for a long-form sequence, as indicated
below:
</para>
<simplelist>
<member><constant>f</constant> filename</member>
<member><constant>p</constant> parent</member>
<member><constant>e</constant> extension</member>
<member><constant>n</constant> number</member>
<member><constant>N</constant> NUMBER</member>
<member><constant>a</constant> artist</member>
<member><constant>c</constant> composer</member>
<member><constant>t</constant> title</member>
<member><constant>l</constant> album</member>
<member><constant>y</constant> year</member>
<member><constant>g</constant> genre</member>
</simplelist>
</refsect2>
<refsect2>
<title>Modifiers</title>
<para>
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}".
</para>
<para>
The full list of modifier characters follows:
</para>
<simplelist>
<member><constant>^</constant> UPPERCASE</member>
<member><constant>_</constant> lowercase</member>
<member><constant>!</constant> Title Case</member>
</simplelist>
</refsect2>
<refsect2>
<title>Conditional Expressions</title>
<para>
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.
</para>
<para>
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:
</para>
<simplelist>
<member>%?<replaceable>expr</replaceable>%?</member>
<member>%?<replaceable>expr</replaceable>%:<replaceable>alt</replaceable>%?</member>
</simplelist>
</refsect2>
</refsect1>
<refsect1 id="refsect1_path_filters">
<title>Path Filters</title>
<para>
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 <emphasis>not</emphasis> match the regular
expression).
</para>
<para>
Use the mount options <option>srcfilter</option> and
<option>dstfilter</option> 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.
</para>
<para>
Multiple filters of any kind may be used, and are applied in the order
that they are specified on the command line. See
<xref linkend="refsect1_examples"/> for some sample filters.
</para>
</refsect1>
<refsect1 id="refsect1_examples">
<title>Examples</title>
<para>
View media files in <filename>src</filename>, with original filenames in a
flat directory structure:
</para>
<screen>$ pytagsfs -o format='/%f' src mnt</screen>
<para>
View media files in <filename>src</filename> by album on
<filename>mnt</filename>:
</para>
<screen>$ pytagsfs -o format='/%a/%f' src mnt</screen>
<para>
A more complex album-based view:
</para>
<screen>$ pytagsfs -o format='/%a - %l/%N %a - %t [%l].%e'</screen>
<para>
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"):
</para>
<screen>$ pytagsfs -o \
format='/%a - %l/%N %a - %t [%l].%e',\
dstfilter='!^/[^/]* - [^/]* - [^/]*/' \
src albums</screen>
<para>
I use this to display the compilations:
</para>
<screen>$ pytagsfs -o \
format='/%l/%N %a - %t [%l].%e',\
dstfilter='^/[^/]* - [^/]*/' \
src compilations</screen>
<para>
Maybe you only want to see files that start with "a" and end in ".mp3"?
</para>
<screen>$ pytagsfs -o \
format='/%f',dstfilter='^/a',dstfilter='\.mp3$' \
src mnt</screen>
</refsect1>
<refsect1>
<title>Unmounting</title>
<para>
To unmount the filesystem on Linux use
<citerefentry>
<refentrytitle>fusermount</refentrytitle>
<manvolnum>1</manvolnum>
</citerefentry>:
</para>
<screen>
$ fusermount -u mnt
</screen>
<para>
To unmount the filesystem on OS X or *BSD use
<citerefentry>
<refentrytitle>umount</refentrytitle>
<manvolnum>1</manvolnum>
</citerefentry>:
</para>
<screen>
$ umount mnt
</screen>
</refsect1>
<refsect1>
<title>Bugs</title>
<para>
Please report bugs on launchpad at
http://launchpad.net/products/pytagsfs/+bugs.
</para>
</refsect1>
<refsect1>
<title>See Also</title>
<para>
<citerefentry>
<refentrytitle>fusermount</refentrytitle>
<manvolnum>1</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>mount</refentrytitle>
<manvolnum>8</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>umount</refentrytitle>
<manvolnum>8</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>pytags</refentrytitle>
<manvolnum>1</manvolnum>
</citerefentry>
</para>
</refsect1>
</refentry>
|