public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* changing the working directory from a c program
@ 2002-03-02  2:26 Wade Brainerd
  2002-03-02  7:37 ` Randall R Schulz
  0 siblings, 1 reply; 2+ messages in thread
From: Wade Brainerd @ 2002-03-02  2:26 UTC (permalink / raw)
  To: cygwin

Hi all,

I'm aware that this is a troublesome issue and hard to do on all
platorms (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
www.wadeb.com


--
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/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: changing the working directory from a c program
  2002-03-02  2:26 changing the working directory from a c program Wade Brainerd
@ 2002-03-02  7:37 ` Randall R Schulz
  0 siblings, 0 replies; 2+ messages in thread
From: Randall R Schulz @ 2002-03-02  7:37 UTC (permalink / raw)
  To: Wade Brainerd, cygwin

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/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-03-02 15:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-02  2:26 changing the working directory from a c program Wade Brainerd
2002-03-02  7:37 ` Randall R Schulz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).