art-helpers

simple helper scripts for managing images processed by ART
git clone https://git.clttr.info/art-helpers.git
Log (Feed) | Files | Refs (Tags) | README | LICENSE

commit 7c5495f16540a563c0347b774d1dd6d762537c2e
parent 1257e7ed7db6f2415735ccdd3dfc3fb8bc300902
Author: René Wagner <apollo@rw-net.de>
Date:   Tue,  1 Oct 2019 21:47:28 +0200

#0000032 use os agnostic directory delimiters

fix newlines in list mode

Diffstat:
MREADME.md | 3++-
Mmultiversion_sidecar_cleaner.pl | 5+++--
Morphaned_sidecar_cleaner.pl | 10++++++----
3 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/README.md b/README.md @@ -8,9 +8,10 @@ The following perl modules are required for running the scripts. - Cwd - File::Basename +- File::Copy - File::Find::Rule - File::Find -- File::Copy +- File::Spec::Functions - Switch ## description diff --git a/multiversion_sidecar_cleaner.pl b/multiversion_sidecar_cleaner.pl @@ -55,13 +55,14 @@ sub main { if ( unlink $file ) { - say 'deleted.' + print 'deleted.' } else { - say " deletion failed: $!"; + print " deletion failed: $!"; } } + say ''; } } diff --git a/orphaned_sidecar_cleaner.pl b/orphaned_sidecar_cleaner.pl @@ -10,9 +10,10 @@ use Cwd; use File::Basename; use File::Find::Rule; use File::Find; +use File::Spec::Functions; use Switch; -my $VERSION = '0.2'; +my $VERSION = '0.3'; my $PROGRAM = 'Orphaned Sidecar Cleaner'; # parse commandline args @@ -56,13 +57,14 @@ sub main { if ( unlink $file ) { - say 'deleted.'; + print 'deleted.'; } else { - say " deletion failed: $!"; + print " deletion failed: $!"; } } + say ''; } } @@ -76,7 +78,7 @@ sub exists_raw_filename my ( $filename, $dirs ) = fileparse($original_file); # Silkypix Sidecar files reside in a "SILKYPIX_DS" folder, so we need to search in the parent folder $filename =~ s/\.\d+\.sp.$//g; - if ( -f dirname($dirs) .'/'. $filename ) + if ( -f catfile(dirname($dirs), $filename) ) { return 1; }