Copy files with a condition

Started by giloutho, October 08, 2012, 10:57:40 AM

Previous topic - Next topic

giloutho

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


Phil Harvey

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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

giloutho

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

giloutho

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

Phil Harvey

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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

giloutho

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

Phil Harvey

Hi Gil,

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

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

giloutho

Thanks a lot... I'll send you a web link when next version is available

Gil