FSpot::DbTools::Paths
use FSpot::DbTool; my $fs = FSpot->new(); my $db_tool = $fs->db_tool(); $db_tool->load_tool( 'Paths' );
Some useful methods for path manipulation
Replace one path with another in the database. Useful if you move all your photos to a new location and want to replace all the old paths
Usage:
$fs->replace_path( from => $from_path, to => $to_path, );
Move all files in a directory from one location to another, and make the changes in the database too.
$fs->replace_path( from => $from_path, to => $to_path, rename => 1, merge => 1 );
rename and merge are optional, and default to 0
rename if enabled will cause files to be renamed by adding a counter to the end of the filename (before extension) in the target directory. e.g. if My_Picture.jpg is to be moved to a directory where My_Picture.jpg already exists, it will be renamed to My_Picture_1.jpg
merge if enabled it will allow files to be merged into an existing directory.
Changes are only made in the database (for each file) if the move for that file was successful.
Find files which exist in the filesystem, but do not exist in the database Returns ArrayRef of lost files
my $lost_files = $fs->lost_files( path => $path );
Find orphaned files (files which exist in in the database, but not on the filesystem) Returns HashRef of database entries for orphans
my $orphans = $fs->find_orphans();
Search for photos with a given base_uri.
wildcard is optional and defaults to 0 if not defined
$fs->seacrh_base_uri( path => $path, wildcard => 1 );
Cleans the trailing slashes from paths
$fs->clean_trailing_slashes();
Robin Clarke perl@robinclarke.net
perl@robinclarke.net
To install FSpot::DbTool, copy and paste the appropriate command in to your terminal.
cpanm
cpanm FSpot::DbTool
CPAN shell
perl -MCPAN -e shell install FSpot::DbTool
For more information on module installation, please visit the detailed CPAN module installation guide.