changing the working directory from a c program

Randall R Schulz rrschulz@cris.com
Sat Mar 2 07:37:00 GMT 2002


Wade,

No more so than in any other POSIX or Unix-like programming model. Child 
processes have next to no ability to directly affect their parents in this 
way. They can send signals, use other IPC processes (sockets, SysV IPC, 
etc.), but all these require cooperation. (Well, signals don't, but they 
don't convey much information, either).

If this were a BSD Unix or Linux, I'd suggest the TIOCSTI ioctl call, which 
simulates typed input. It would be a horrible hack and highly susceptible 
to interference and misinterpretation of the simulated typing, but under 
restricted circumstances, it might work. That ioctl call does not appear to 
be implemented in Cygwin.

Randall Schulz
Mountain View, CA USA


At 02:26 2002-03-02, Wade Brainerd wrote:
>Hi all,
>
>I'm aware that this is a troublesome issue and hard to do on all platforms 
>(Win32, various Unix's) but I'm asking anyway :)
>
>Under Cygwin, is there any way for a C program to change the current 
>working directory of the shell that executed it?  My best bet so far is to 
>wrap the C program in a script.
>
>Thanks,
>Wade Brainerd


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list