Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
118 user(s) are online (90 user(s) are browsing Forums)

Members: 1
Guests: 117

trixie, more...

Support us!

Headlines

 
  Register To Post  

Waiting a SystemTags() for terminating?
Not too shy to talk
Not too shy to talk


See User information
Hello

From my C program I start an external command with SystemTags() (say) "mycommand"

The context:
The C program generate a file (say) myfile.txt
Then I do a SystemTags() "mycommand myfile.txt mymodifiedfile.txt" to obtain (say) mymodifiedfile.txt
BUUUT SystemTags returns before the treatment is done so mymodifiedfile.txt is not here or not finished

So how to resolve that ?
Is there a synchronous mode for SystemTags ? or an other function to use ?


Many Thanks




Go to top
Re: Waiting a SystemTags() for terminating?
Quite a regular
Quite a regular


See User information
If using the C library is not a problem, then you can replace it with system(), which will always wait for the command's completion.

This is just like television, only you can see much further.
Go to top
Re: Waiting a SystemTags() for terminating?
Home away from home
Home away from home


See User information
@thellier

SYS_Aync tag defaults to FALSE, so the default behaviour should be to wait for the command to finish. Have you set it TRUE or something?

Go to top
Re: Waiting a SystemTags() for terminating?
Not too shy to talk
Not too shy to talk


See User information
>If using the C library is not a problem, then you can replace it with system
OK I will give it a try

>SYS_Async tag defaults to FALSE
Seems that this tag despite his name dont do sync/async but close or not the input/ouput

Thanks

Go to top
Re: Waiting a SystemTags() for terminating?
Not too shy to talk
Not too shy to talk


See User information
No, that's not true. SystemTags() definitely is syncronous unless you set SYS_Async to TRUE.

Maybe the program you run as mycommand detaches itself from the shell. Then you'll have a hard time to wait for its end.

A normal program which blocks the shell until it is finished will also let SystemTags block until the program returns.

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project