Login
Username:

Password:

Remember me



Lost Password?

Register now!
Sections
Who's Online
43 user(s) are online (33 user(s) are browsing Forums)

Members: 0
Guests: 43

more...
Support us!
Recent OS4 Files
OS4Depot.net





Waiting a SystemTags() for terminating?
Just popping in
Joined:
2011/6/3 12:49
Posts: 213
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




   Report Go to top

Re: Waiting a SystemTags() for terminating?
Quite a regular
Joined:
2013/10/17 15:21
From Hungary
Posts: 563
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.

_________________
I see the jimmies have been rustled.
   Report Go to top

Re: Waiting a SystemTags() for terminating?
Home away from home
Joined:
2006/12/4 23:15
Posts: 2007
@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?

_________________
Blender For OS4.x : Blues : Walker Broad
   Report Go to top

Re: Waiting a SystemTags() for terminating?
Just popping in
Joined:
2011/6/3 12:49
Posts: 213
>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

   Report Go to top

Re: Waiting a SystemTags() for terminating?
Not too shy to talk
Joined:
2006/11/26 17:45
Posts: 268
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.

   Report Go to top





[Advanced Search]


Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project