|
Smugfs is a user-level file system that provides access to images
stored on the SmugMug photo sharing service. It logs in after
obtaining a password from factotum(4) using server=smugmug.com
and keypattern (if any) as key criteria (see auth(3)). Then smugfs
serves a virtual directory tree mounted at mtpt (default /n/smug)
and posted at srvname
, if the −s option is given.
The directory tree is arranged in five levels: root, user, category,
album, and image. For example, /n/smug/cmac/ is a user directory,
/n/smug/cmac/People/ is a category directory, /n/smug/cmac/People/Friends/
is an album directory, and /n/smug/cmac/albums/Friends/2631/ is
an image directory.
SmugMug allows fine-grained classification via subcategories,
but subcategories are not yet implemented.
All directories contain a special control file named ctl; text
commands written to ctl change smugfs’s behavior or implement
functionality that does not fit nicely into the file system interface.
Smugfs caches information about users, categories, albums, and
images. If changes are made outside of smugfs (for example, using
a web browser), the cache may need to be discarded. Writing the
string sync to a directory’s ctl file causes smugfs to discard
all cached information used to present that directory and its
children. Thus, writing sync to
the root ctl file discards all of smugfs ’s cached information.
Root directory
The root directory contains directories named after users. By
default, it contains only a directory for the logged-in user,
but other directories will be created as needed to satisfy directory
lookups.
In addition to user directories, the root directory contains three
special files: ctl, rpclog, and uploads. Reading rpclog returns
a list of recent RPCs issued to the SmugMug API server. Reads
at the end of the file block until a new RPC is issued. The uploads
file lists the file upload queue (q.v.).
User directories
User directories contain category directories named after the
categories. SmugMug pre-defines a variety of categories, so it
is common to have many categories that do not contain albums.
In a user directory, creating a new directory creates a new category
on SmugMug. Similarly, renaming or removing a category directory
renames or removes the category on SmugMug. Categories cannot
be removed if they contain albums.
User directories also contain a directory named albums that itself
contains all of that user’s albums.
Category directories
Each category directory contains album directories named using
the album’s title.
In a category directory, creating a new directory creates a new
album on SmugMug. Similarly, renaming or removing an album directory
renames or removes the album on SmugMug. Albums cannot be removed
if they contain images.
Album directories
Each album directory contains image directories named using the
image’s decimal SmugMug ID. Image directories cannot be created
or renamed, but they can be removed. Removing an image directory
removes the image from the album on SmugMug.
Album directories also contain three special files, ctl, settings,
and url.
The settings file contains the album settings in textual form,
one setting per line. Each line represents a single setting and
is formatted as an alphabetic setting name followed by a single
tab followed by the value. Many settings can be changed by writing
new setting lines, in the same format, to the settings file.
Copying a file into the album directory queues it for uploading
to SmugMug to be added to the album. Files disappear from the
album directory once they have finished uploading, replaced by
new image directories. The uploads file in the root directory
lists all pending uploads, which are stored temporarily in /var/tmp.
Image directories
Each image directory contains an image file, named with its original
name, if available. If the image belongs to another user, SmugMug
does not expose the original name, so the file is named nnnn.jpg,
where nnnn is the SmugMug image ID number. The file content is
the original image or else the largest image available.
The directory contains a settings file holding per-image settings,
similar to the file in the album directory; and a url file, containing
URLs to the various sized images on the SmugMug server.
|