doitux
21-09-2004, 10:07
Hallo.
Ich hab ein Programm welches mir ein bash-script generiert:
QString atcmd = "/tmp/atcmd";
QFile file1( atcmd ); // Write the text to a file
if ( file1.open( IO_WriteOnly ) ) {
QTextStream stream( &file1 );
stream << "#!/bin/bash -xv\n";
stream << "at -f ";
stream << save;
stream << " ";
stream << start_time;
stream << " ";
stream << start_date;
stream << "\n";
stream << "rm ";
stream << atcmd;
}
danach wird das script ausführbar gemacht:
chmod1 = new QProcess( this );
chmod1->addArgument( "chmod" );
chmod1->addArgument( "ugo+x" );
chmod1->addArgument( save );
chmod1->addArgument( atcmd );
chmod1->start();
jetzt möchte ich gerne das script starten:
go = new QProcess( this );
go->addArgument( atcmd );
go->start();
dieses wird leider nicht richtig abgearbeitet. auf jeden fall kann ich mit einem atq nichts davon sehen. wenn ich das script dann per hand starte funtioniert das.
Hat jemand eine idee was ich da falsch mache?
gruß
doitux
ps: den ganzen quellcode gibts unter http://paste.phpfi.com/30530
Ich hab ein Programm welches mir ein bash-script generiert:
QString atcmd = "/tmp/atcmd";
QFile file1( atcmd ); // Write the text to a file
if ( file1.open( IO_WriteOnly ) ) {
QTextStream stream( &file1 );
stream << "#!/bin/bash -xv\n";
stream << "at -f ";
stream << save;
stream << " ";
stream << start_time;
stream << " ";
stream << start_date;
stream << "\n";
stream << "rm ";
stream << atcmd;
}
danach wird das script ausführbar gemacht:
chmod1 = new QProcess( this );
chmod1->addArgument( "chmod" );
chmod1->addArgument( "ugo+x" );
chmod1->addArgument( save );
chmod1->addArgument( atcmd );
chmod1->start();
jetzt möchte ich gerne das script starten:
go = new QProcess( this );
go->addArgument( atcmd );
go->start();
dieses wird leider nicht richtig abgearbeitet. auf jeden fall kann ich mit einem atq nichts davon sehen. wenn ich das script dann per hand starte funtioniert das.
Hat jemand eine idee was ich da falsch mache?
gruß
doitux
ps: den ganzen quellcode gibts unter http://paste.phpfi.com/30530