So I am able to have the QProcess execute the unzip and untar but when I try and run something after the untar nothing appears to be happening.
{
if(okToContinue())
{
QString fileName
= QFileDialog::getOpenFileName(this, tr
("Open file.tar.gz file"),
".", tr
("gzip tarball" "(*.tar.gz)"));
if(!fileName.isEmpty())
{
arguments << "-ext2here" << fileName;
unarchive->start("peazip", arguments);
if(unarchive->waitForFinished())
{
fileName.remove(".gz");
arguments.clear();
arguments << "-ext2here" << fileName;
int exitCode = unarchive->execute("peazip", arguments);
if(unarchive->waitForFinish())
{
fileName.remove("file.tar");
// this is the path that is extracted from tar and the .csv is what I am after
fileName.append(("tmp/file/A.csv"));
loadFile(fileName);
}
}
}
}
}
QMainWindow::open()
{
if(okToContinue())
{
QString fileName = QFileDialog::getOpenFileName(this, tr("Open file.tar.gz file"), ".", tr("gzip tarball"
"(*.tar.gz)"));
if(!fileName.isEmpty())
{
QProcess *unarchive = new QProcess(this);
QStringList arguments;
arguments << "-ext2here" << fileName;
unarchive->start("peazip", arguments);
if(unarchive->waitForFinished())
{
fileName.remove(".gz");
arguments.clear();
arguments << "-ext2here" << fileName;
int exitCode = unarchive->execute("peazip", arguments);
if(unarchive->waitForFinish())
{
fileName.remove("file.tar");
// this is the path that is extracted from tar and the .csv is what I am after
fileName.append(("tmp/file/A.csv"));
loadFile(fileName);
}
}
}
}
}
To copy to clipboard, switch view to plain text mode
It never seems to make it inside the second waitForFinish if statement. What am I doing wrong?
Thanks for help!
Bookmarks