ExifTool Forum

ExifTool => Developers => Topic started by: hh_19329 on March 13, 2019, 03:37:18 AM

Title: Question to creating a html dump file with the C++ interface
Post by: hh_19329 on March 13, 2019, 03:37:18 AM
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.
Title: Re: Question to creating a html dump file with the C++ interface
Post by: Phil Harvey on March 13, 2019, 07:13:21 AM
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