Question to creating a html dump file with the C++ interface

Started by hh_19329, March 13, 2019, 03:37:18 AM

Previous topic - Next topic

hh_19329

Hi Phil.

Currently, I've been trying to create a html dump file with your C++ interface using Command function in Exiftool.h, but it doesn't work at all.
It doesn't create the file.

Here's is the code I used


std::string imageName = argv[1] + "\n";
std::string cmd = "-htmldump\n" + imageName + ">\n" + "dump.html";
int num = exifTool->Command(cmd.c_str());


Can you tell me what's wrong with this code? Thank you.

Phil Harvey

You can't do shell redirection with these commands.

Use cmd = "-htmldump\n" + imageName + "\n";

Then call Complete() to be sure the command has completed.  After this, call GetOutput() to retrieve the html string.  After this, open "dump.html" in C++ and write the string to the file.

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