ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: giloutho on October 08, 2012, 10:57:40 AM

Title: Copy files with a condition
Post by: giloutho on October 08, 2012, 10:57:40 AM
Hi Phil,


Congratulations for your fantastic work. I'll use Exiftool for geotagging IGC paragliders tracks.

After geotagging, I want to move only modified files in a specific directory.

No problems when I try a simple copy
exiftool SRCDIR -o DSTDIR

No problems when I try a list of just modified files with geotagging process :
exiftool -filemodifydate -if '$filemodifydate ge "2012:10:08 15:12" ' SRCDIR

But when I try :
exiftool SRCDIR -o DSTDIR -if '$filemodifydate ge "2012:10:08 15:12" '
exifTool returns an error 1.

Where is the problem ?

Thanks in advance.

Gil

Title: Re: Copy files with a condition
Post by: Phil Harvey on October 08, 2012, 12:13:50 PM
Hi Gil,

I don't understand because this seems to work for me.  What exiftool version are you using?

> rm tmp/*
> exiftool a.jpg -filemodifydate
File Modification Date/Time     : 2003:12:04 06:46:52-05:00
> exiftool a.jpg -o tmp -if '$filemodifydate ge "2012"'
    1 files failed condition
> echo $?
1
> exiftool a.jpg -o tmp -if '$filemodifydate ge "2000"'
    1 image files copied
> echo $?
0
> ls tmp
a.jpg


- Phil
Title: Re: Copy files with a condition
Post by: giloutho on October 08, 2012, 12:39:11 PM
I think the last version of ExifTool.

I began working with Exiftool last week. I use perl version on MacOS 10.6.8.

I want to add Exiftool as an external library in a flight logbook software. I run Exiftool commands in my software as shell commands.

I'm going to try with Terminal.

Many thanks
Title: Re: Copy files with a condition
Post by: giloutho on October 08, 2012, 05:04:35 PM
Hi Phil,

It's very strange.

First I try in MacOS Terminal application :
exiftool SRCDIR -o DSTDIR -if '$filemodifydate ge "2012:10:08 15:12" '
No result, no error message...

I try :
exiftool -if '$filemodifydate ge "2012:10:08 15:12" ' SRCDIR -o DSTDIR
it's OK... I have a report of ExifTool with
1 directories scanned
   10 files failed condition
    9 image files read


When I run in RealBasic a shell command ExifTool with param like :
-if '$filemodifydate ge "2012:10:08 15:12" ' SRCDIR -o DSTDIR
I have a result with "error 1" but  image files are copied. It's OK... I'm going to check programmatically.

Many thanks
Title: Re: Copy files with a condition
Post by: Phil Harvey on October 09, 2012, 07:24:54 AM
This doesn't make sense.  There must be something else happening that I don't see here.

Are you sure that the SRCDIR and DSTDIR were exactly the same in both cases?

- Phil
Title: Re: Copy files with a condition
Post by: giloutho on October 09, 2012, 08:07:01 AM
Hi Phil,

QuoteAre you sure that the SRCDIR and DSTDIR were exactly the same in both cases?
Yes... I worked only with copy paste...

It doesn't matter, I copy images files in a empty folder. At the end of Exiftool operations, I can check programmatically.

Exiftool is a fantastic library. Do you agree to adding Exiftool functionalities at my software.  Obviously I put a mention of your work and the Exiftool web adress.

Many thanks.

Gil
Title: Re: Copy files with a condition
Post by: Phil Harvey on October 09, 2012, 09:17:42 AM
Hi Gil,

Yes, you are free to use ExifTool in your software.

- Phil
Title: Re: Copy files with a condition
Post by: giloutho on October 09, 2012, 09:51:13 AM
Thanks a lot... I'll send you a web link when next version is available

Gil