"Can't open perl script "-e"; No such file or directory" running ExifTool.exe

Started by Allen B. Taylor, February 10, 2011, 01:04:48 PM

Previous topic - Next topic

Allen B. Taylor

When attempting to run ExifTool.exe on a Windows XP Embedded system, I get the error message:
"Can't open perl script "-e"; No such file or directory".
No command line arguments are specified, I just run ExifTool from cmd prompt. On a regular Windows system, it displays the help.

Phil Harvey

It sounds like this installation is corrupted.  I suggest following the uninstalling instructions, then re-install.

- 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 ($).

Allen B. Taylor

Phil,

I did the reinstall and it still doesn't work. On my WinXPe machine, the C: drive is 200 MB with only 20 MB free. (It's a stripped-down version of WinXP.) It also has a write filter engaged so that writes to it are not saved between reboots. So to rule out any problems with this disk, I redefined TEMP to point to my data disk, a 4 GB NTFS volume, drive M:.

mkdir M:\Temp
set TEMP=M:\Temp

I downloaded latest version of ExifTool windows executable and extracted to my M: drive in another folder. Renamed exiftool(-k).exe to exiftool.exe and ran for the first time on a freshly rebooted system. I still get the same error message.

I looked in the TEMP directory and it contains the following files:

M:\Temp
  par_SYSTEM
    cache-exiftool-8.48
      exiftool.exe 53,299 bytes (much smaller than the distributed one)
      perl58.dll 815,185 bytes

Only 2 files. I noticed that on my regular Window system there are many more files, plus an inc directory, etc. Do you think the first-time run is failing, or is this normal behaviour?

Allen

Phil Harvey

Hi Allen,

As far as I know, the unpacker always unpacks all of the files the first time it runs.  So it sounds like a problem to me if the cache-exiftool-8.48 directory contains only 2 files.

I can't think of any way to diagnose this since the PAR packer isn't very good at issuing warning messages.  It sounds like you have lots of disk space so this shouldn't be the problem.

Does it unpack only the same 2 files each time?

Can you validate the MD5 checksum of your distribution?:

MD5 (exiftool-8.48.zip) = f0976777e2ebef39693d78a5661bc323

- 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 ($).

Allen B. Taylor

Hi Phil,

Yes, it unpacks the same two files each time. At this point, I'm wondering if my WinXPe system is missing something that ExifTool needs. I did a dependency checker on the cached (small) version of exiftool and I believe I have everything (it needs WS2_32.DLL and SHELL32.DLL; both are present in my system).

I don't know much about this PAR thing. Anyplace you can suggest to find out more about this?

Allen

Phil Harvey

The PAR packager can be found here.

The documentation mentions some environment variables like PAR_GLOBAL_DEBUG and PAR_VERBOSE that look interesting...

- 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 ($).

Allen B. Taylor

Phil,

Setting PAR_GLOBAL_DEBUG and PAR_VERBOSE each to 1 does nothing when running exiftool. These must only have an effect when packing, not unpacking.

I tried copying a freshly created cache from my WinXP system to the XPe system, but it still gives the same error. I'm guessing that exiftool first unpacks the small version of exiftool and the perl DLL, then does something else (which fails under my XPe), and then unpacks the rest. Regardless of whether the cache is populated, the same failure occurs.

What would exiftool be doing to make it think it needs to execute a script called "-e"?

Allen

Phil Harvey

Quote from: Allen B. Taylor on February 10, 2011, 05:04:26 PM
Setting PAR_GLOBAL_DEBUG and PAR_VERBOSE each to 1 does nothing when running exiftool. These must only have an effect when packing, not unpacking.

I was wondering about this.

Quote
What would exiftool be doing to make it think it needs to execute a script called "-e"?

ExifTool doesn't run Perl scripts (other than itself), so this must be a message from PAR.

How much RAM does your system have?  I suppose the unpacker could fail if it doesn't have enough.

- 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 ($).

Allen B. Taylor

XPe is running on a PC/104 stack, specifically, a CMA22MCS1200HR-1024 with 1GB RAM. I don't think RAM is an issue.

Likely, it's some strange bug in PAR that only occurs on XPe. Since I can't debug it here, I'm thinking of installing a Perl environment and running your Perl distribution. Will ExifTool run under Strawberry Perl?

Allen

Phil Harvey

Hi Allen,

Installing Perl yourself does look like the way to go.  ExifTool will run under a basic Perl installation, but you may need to install optional packages to enable some extra features.  The dependencies section of the README of the full distribution explains this:

QuoteDEPENDENCIES

Requires Perl version 5.004 or later.  No other special libraries are
required, however the following modules are recommended for decoding
compressed and/or encrypted information from the indicated file types, and
for calculating digest values for some information types:

Archive::Zip        (ZIP, DOCX, PPTX, XLSX, ODP, ODS, ODT, EIP and iWork)
Compress::Zlib      (DNG, PNG, PDF, DCM, MIE and SWF files)
Digest::MD5         (PDF files, IPTC information, and Extended XMP in JPEG)
Digest::SHA         (PDF with AES-256 encryption)
IO::Compress::Bzip2 (RWZ files)

- 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 ($).

Allen B. Taylor

I'm using ExifTool to add metadata (standard + custom XMP) to JP2 (JPEG 2000) files. Not the same as old JPEG, so I should be alright. I'll let you know how it goes.

Allen B. Taylor

It works! I installed the "portable" version of Strawberry Perl (requires no installation, just unzip, path setup and definition of TERM variable), installed Image-ExifTool in my application directory, wrote a quick exiftool.bat to run exiftool.pl under perl (so I don't have to change the application code that runs exiftool), and it works. I bit ugly, but it works.

I'm still puzzled why PAR would behave so oddly under XPe. But like you said, this is a PAR problem, not an ExifTool problem.

Thanks for thinking this one through with me.

Allen

Phil Harvey

I'm puzzled by the PAR problem too, but I'm glad you could install Perl and get it working that way.

- 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 ($).

kmmareek

I have the same problem on XP Pro SP2. In par-USER direstory i have only 2 files. When I copied all the files from par-USER (from another computer where exiftool working fine) to my computer par-USER are still the same error. What i have to do ?

Phil Harvey

Try typing "set" then RETURN at the cmd.exe prompt, and post the results.  I may get a hint about the problem if I can see your system environment settings.

- 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 ($).

kmmareek

Quote from: Phil Harvey on April 25, 2012, 07:12:42 AM
Try typing "set" then RETURN at the cmd.exe prompt, and post the results.  I may get a hint about the problem if I can see your system environment settings.

- Phil

Yesterday I installed the ActivePerl-5.14 but :(

set:
ALLUSERSPROFILE=C:\Documents and Settings\All Users
APPDATA=C:\Documents and Settings\Rafalk\Dane aplikacji
CommonProgramFiles=C:\Program Files\Common Files
COMPUTERNAME=RKL
ComSpec=C:\WINDOWS\system32\cmd.exe
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
HOMEPATH=\Documents and Settings\Rafalk
LOGONSERVER=\\RKL
MIGO_DRIVE=P
NUMBER_OF_PROCESSORS=2
Oracle_SID=ora
OS=Windows_NT
Path=C:\Program Files\Perl\site\bin;C:\Program Files\Perl\bin;C:\oracle\product\11.1.0\client_1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\oracle\product\11.1.0\db_1\bin;C:\Program Files\PC Connectivity Solution\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;C:\Program Files\ThinkPad\Utilities;C:\Program Files\Common Files\Lenovo;C:\Program Files\Lenovo\Client Security Solution;C:\Program Files\QT Lite\QTSystem;E:\;
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 6, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=0f06
ProgramFiles=C:\Program Files
PROMPT=$P$G
RR=C:\Program Files\Lenovo\Rescue and Recovery
SESSIONNAME=Console
SMA=C:\Program Files\ThinkVantage\SMA\
SWSHARE=C:\SWSHARE
SystemDrive=C:
SystemRoot=C:\WINDOWS
TEMP=C:\DOCUME~1\Rafalk\USTAWI~1\Temp
TMP=C:\DOCUME~1\Rafalk\USTAWI~1\Temp
TVT=C:\Program Files\Lenovo
TVTCOMMON=C:\Program Files\Common Files\Lenovo
TVTPYDIR=C:\Program Files\Common Files\Lenovo\Python24
USERDOMAIN=RKL
USERNAME=Rafalk
USERPROFILE=C:\Documents and Settings\Rafalk
windir=C:\WINDOWS
__COMPAT_LAYER=EnableNXShowUI


PH Edit: Put "set" output in a code block

Phil Harvey

Thanks.

This looks very similar to my XP environment here.  The one difference is the location of your temporary directory.  Mine is "C:\DCOUME~1\Phil\LOCALS~1\Temp" which corresponds to "c:\Documents and Settings\Phil\Local Settings\Temp".  Your temporary directory is "C:\DOCUME~1\Rafalk\USTAWI~1\Temp", which is a bit different.  I just want to confirm that you looked in this directory for the "par-Rafalk" directory containing the ExifTool temporary files.

Also, since you now have Perl installed, you should be able to run the pure Perl version of ExifTool (the first download link on the ExifTool home page).  Did you try this?

- 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 ($).

kmmareek

Mine directory is C:\DOCUME~1\Rafalk\USTAWI~1\Temp  which means USTAWIENIA LOKALNE (XP-Polish wersion).
Yes, I was looking in par-Rafalk (only perl58.dll and exiftool.exe).
c:\Documents and Settings\Rafalk\Local Settings\Temp is empty.

I can run the pure Perl version... but this is not the solution ;(


Phil Harvey

OK, thanks.  I think we're on solid footing now.

The ExifTool temporary files should be inside a directory named "cache-exiftool-8.89" inside par-Rafalk... I'm assuming that's where you found perl58.dll and exiftool.exe?  In my installation, perl58.dll and exiftool(-k).exe are in this directory, along with a number of other files.

I'm not sure what could possibly cause PAR to fail extracting all of these files.  I suppose it could be some sort of permission problem if PAR launches a process with different access rights to do the unpacking.  I don't know how directory permissions work in Windows, but you might try making the "par-Rafalk\cache-exiftool-8.89" directory writable by anyone.

Also, just in case there is something with this specific version, did you try other exiftool versions?  As well, it seems that you renamed "exiftool(-k).exe" to "exiftool.exe".  I don't think this could be the problem, but try just double clicking on the distributed "exiftool(-k).exe" after just removing it from the zip archive without doing anything else first.

- 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 ($).

kmmareek

Files: perl58.dll (815185bytes) and exiftool.exe (53299bytes) is in temp\cache-exiftool-8.89.
I added permissions (write etc) for temp\ for everyone.
I've tried other version of exiftool: 8.61, 8.88...
It makes no difference whether I run the exiftool.exe or exiftool(-k).exe.
Anyway, thank you for your interest :)

Phil Harvey

These files are the same size as the ones I get (except mine is called "exiftool(-k).exe").

But for some reason, PAR isn't unpacking the files it needs.  This is clearly a system-dependent PAR problem, but at this point I am running out of ideas about how to proceed.  I really don't know much about the inner workings of PAR, and I can't reproduce this problem here, so this problem may be difficult for me to solve.

- 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 ($).

kmmareek

Is it possible to be OK if i copy content of the par-USER catalog from another computer on which the exiftool operates? Can you place the contents of a par-USER directory on your website? :)
Once again thank you for your interest! :)

Phil Harvey

OK, I'll upload the contents of my par-Phil tomorrow when I'm back on a fast internet connection.

I just tried deleting all of the par-Phil/cache-exiftool-8.89 files except for perl58.dll and exiftool(-k).exe, and it re-created the others when I ran the distributed version of exiftool(-k).exe.  So the problem isn't just that it didn't unpack properly for you the first time.

I suppose that some over-active virus protection software could possibly prevent exiftool from writing these files... Do you have virus protection installed?  If so, you might try disabling it for a test.

- 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 ($).

kmmareek


Phil Harvey

The cache directory for exiftool(-k).exe version 8.89 may be downloaded from here:

cache-exiftool-8.89.zip

- 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 ($).

kmmareek

Thank you, I checked, but does not work. Still Can't open perl script "-e"

Phil Harvey

Well, it was worth a try.

The error message is a bit odd because "perl -e EXPR" executes the expression on the command line, but the message seems to indicate that it is looking for a Perl script named "-e", as if it had interpreted "-e" as a file name.  I took a look at the PAR code to see if I could figure out how this might happen, but didn't get very far.

- 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 ($).

kmmareek

I loged (process monitor) action when run exiftool.

I wonder what it means :
cache-exiftool-8.89\site\5.8.7\
cache-exiftool-8.89\lib
cache-exiftool-8.89\ShimEng.dll
??

Phil Harvey

This log is useful.  Did you perhaps try to run exiftool.exe instead of exiftool(-k).exe?

I don't see any accesses to "exiftool(-k).exe" in your temp directory, but I see some for "exiftool.exe" which doesn't exist in the cache file I sent.

- 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 ($).

kmmareek

I run exiftool.exe (after rename it from exiftool(-k).exe). Does not matter if I run exiftool or exiftool(-k). It creates exiftool.exe (53299B) in c:\Documents and Settings\Rafalk\Ustawienia lokalne\temp\par-Rafalk\cache-exiftool-8.89\.
At attachment: Process Monitor log http://technet.microsoft.com/en-us/sysinternals/bb896645

P.S. sorry for my english :)

Phil Harvey

I'm just confused because this is not what I observed.  In the zip file I uploaded, you will find that only "exiftool(-k).exe" was created when I ran exiftool on my system.

I don't know if this is related to the problem, but little inconsistencies like this can sometimes be the key to finding a solution.

I can't look at the process log right now, but I will when I get a chance.

- 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 ($).

kmmareek

Quote from: Phil Harvey on April 26, 2012, 11:09:59 AM
I'm just confused because this is not what I observed.  In the zip file I uploaded, you will find that only "exiftool(-k).exe" was created when I ran exiftool on my system.

Yes, exiftol.exe(small) itself creates.

In exiftool.exe(small) is:

package main;

require PAR;
unshift @INC, \&PAR::find_par;
PAR->import(@par_args);

die qq(par.pl: Can't open perl script "$progname": No such file or directory\n)
    unless -e $progname;


It looks similar to our problem...

Phil Harvey

Interesting.  Is this exactly the code that generates the error?  ie) Does it print out "par.pl:" at the start of the message?

If so, then we just need to figure out why $progname is "-e" instead of what it should be.

- 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 ($).

kmmareek

exiftool.exe under cmd:

c:\exiftool>exiftool
Can't open perl script "-e": No such file or directory


rmarhi

FWIW I just recently had this same error message on Windows10. While troubleshooting another application that had stopped working I came across this issue - 'NUL file missing in windows'. I was led to a page to set the defaults for Null Service in Windows 10 <http://servicedefaults.com/10/null/> and this service reset/restart resolved the exif error.

Phil Harvey

...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 ($).