You are not logged in.

Dear visitor, welcome to If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.


Wednesday, August 10th 2005, 10:35am

How can I know when a process ends?

I use system() to create a new process,but I have no idea when it end,how can I know it?

eg.system("cp -r "+s+" /mnt/usb") ; I want to copy a derectory (s) to /mnt/usb ,and I want to know when copy event finishes?
please help me ,thanks!

This post has been edited 1 times, last edit by "calf9007" (Aug 10th 2005, 10:36am)


Wednesday, August 10th 2005, 10:44am

RE: How can I know when a process ends?

The system command returns after the command has finished, so after this call the copy operation itself is done, but you should either call sync afterwards to ensure that the data is also copied on the operating system layer (flushed the buffers) or mount your device with the sync option.
There's no place like ::1

  • "wysota" is male

Posts: 4,276

Location: Warsaw, POLAND

  • Send private message


Wednesday, August 10th 2005, 10:46am

RE: How can I know when a process ends?

System does a synchronous call, which means that it returns when the called process ends.

Moving the thread to C++ programming, as it's not related to Qt programming.