Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!ukc!tcdcs!wsl!john From: john@wsl.UUCP (John Allen on wsl) Newsgroups: comp.lang.c Subject: Re: TurboC again Message-ID: <296@wsl.UUCP> Date: 6 Feb 90 03:02:09 GMT References: Reply-To: john@wsl.ie (John Allen on wsl) Organization: Workhorse Systems, Dublin, Ireland Lines: 24 Summary: Expires: Sender: Followup-To: In article bg0l+@andrew.cmu.edu (Bruce E. Golightly) writes: > >The statement: > > system("sort c:\\directory\\filename.ext"); > >from this state, the system hangs up badly. Suggestions? > try this /* connect stdin & stdout to the files you want to process */ freopen("c:/directory/filename.ext", "r", stdin); freopen("c:/directory/filename.ext", "w", stdout); /* spawn the program */ spawnlp(P_WAIT, "sort", "sort", NULL); /* connect stdin & stdout back to the console */ freopen("con", "r", stdin); freopen("con", "w", stdout); -- People that don't know want to know from the people that do know and if the poeple that do know don't tell the people that don't know then the people that don't know still won't know. "Don't quote me on any issue whatsoever."