Results 1 to 5 of 5
Hello,
I'm developing a website YouTUBE like and I need to create a module which upload's a movie and after that I convert's to flv.
So to convert a file ...
- 08-24-2008 #1Just Joined!
- Join Date
- Aug 2008
- Posts
- 3
How can I know when an instance of any application ends?
Hello,
I'm developing a website YouTUBE like and I need to create a module which upload's a movie and after that I convert's to flv.
So to convert a file to flv I need to execute an application and I would like to know when it ends because this application does not save the file in a temp directory and after that moves it on the output folder so that I will know when a file is completed.
So does anyone know a way how can I see when the conversion is done?
Thank you!
- 08-25-2008 #2
How are you executing the application?
In C, for instance, when you fork(), the parent process gets the PID of the child process. It can then use the waitpid() function to halt until the child finishes, then it can continue.
I imagine that most languages support some similar feature.DISTRO=Arch
Registered Linux User #388732
- 08-25-2008 #3Just Joined!
- Join Date
- Aug 2008
- Posts
- 3
Well I'm using PHP exec(). So I don't know if there exists any waitPID function.
- 08-25-2008 #4Just Joined!
- Join Date
- Aug 2008
- Posts
- 3
I actually don't want that user to wait for the whole conversion process. I just want that the server to know when the video is available to watch.
Do you know any way?
- 08-26-2008 #5
Well, how about instead of executing the converter program, you execute another program of yours that executes the converter program. This second program of yours can wait for the converter to finish and then notify your database or whatever.
You might want to read:
PHP: exec - Manual
It discusses how to cause exec() to wait or not.DISTRO=Arch
Registered Linux User #388732


Reply With Quote