Changeset 218
- Timestamp:
- Oct 9, 2009, 11:34:45 PM (16 years ago)
- Location:
- tests/process
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/process/process/process.cpp
r209 r218 219 219 } 220 220 } 221 else if (cmd == "d" || cmd == "dcd") 222 { 223 QString workDir; 224 if (cmd.endsWith("cd")) 225 { 226 QDir dir = QDir(QFileInfo(words[0]).path()); 227 workDir = dir.absolutePath(); 228 } 229 else 230 { 231 workDir = QDir::currentPath(); 232 } 233 mEditor->append(tr("> Working directory: '%1'").arg(workDir)); 234 235 mEditor->append(tr("> Detaching: '%1'").arg(text)); 236 QStringList args = words; 237 QString prg = args.takeFirst(); 238 qint64 pid; 239 if (QProcess::startDetached(prg, args, workDir, &pid)) 240 mEditor->append(tr("> Detached successfully (pid '%1')").arg(pid)); 241 else 242 mEditor->append(tr("> Detach failed")); 243 } 221 244 else 222 245 { -
tests/process/test/test.cpp
r205 r218 21 21 #if 1 22 22 23 sleep(3);23 //sleep(3); 24 24 int rc = write(fileno(stdout), "test-test", 9); 25 25 fprintf(stderr, "rc=%d %s\n", rc, strerror(errno)); 26 sleep(3);26 //sleep(3); 27 27 rc = write(fileno(stdout), "\nend", 4); 28 28 fprintf(stderr, "rc=%d %s\n", rc, strerror(errno)); 29 sleep(3);29 //sleep(3); 30 30 return 0; 31 31
Note:
See TracChangeset
for help on using the changeset viewer.