avis_phoenix
2nd August 2010, 20:03
Hi, I'm try to do a simple tool in QT; this tool convert files from dos format to unix format, using tr program
The I use a QProcess to comunicate tr with my program, but I failed to make it work, because in the error output ( readAllStandardError() ) say:
"usage: tr [-Ccsu] string1 string2
tr [-Ccu] -d string1
tr [-Ccu] -s string1
tr [-Ccu] -ds string1 string2"
and the files are not modified...
What is my mistake??
The statement I am trying to use is:
tr -d "\015" < DOS_File
The code is this:
QProcess *td;
QString prg,file;
td = new QProcess(this);
prg = "tr -d \"\\015\" < " + file;
td->start(prg);
I have also tried to use this:
QProcess *td;
QStringList inst;
QString file;
td = new QProcess(this);
inst<< "-d"<<"\"\\015\""<<"<"<<file;
td->start("tr",inst);
I'm use QT 4.6 in mac
Thanks
The I use a QProcess to comunicate tr with my program, but I failed to make it work, because in the error output ( readAllStandardError() ) say:
"usage: tr [-Ccsu] string1 string2
tr [-Ccu] -d string1
tr [-Ccu] -s string1
tr [-Ccu] -ds string1 string2"
and the files are not modified...
What is my mistake??
The statement I am trying to use is:
tr -d "\015" < DOS_File
The code is this:
QProcess *td;
QString prg,file;
td = new QProcess(this);
prg = "tr -d \"\\015\" < " + file;
td->start(prg);
I have also tried to use this:
QProcess *td;
QStringList inst;
QString file;
td = new QProcess(this);
inst<< "-d"<<"\"\\015\""<<"<"<<file;
td->start("tr",inst);
I'm use QT 4.6 in mac
Thanks