home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!acd4!iedv6!dwj
- From: dwj@iedv6.acd.com ( Dan Johnson )
- Subject: Re: Where does system("cd ./sudir") go ?
- Message-ID: <1993Jan28.223830.8725@acd4.acd.com>
- Sender: news@acd4.acd.com (USENET News System)
- Organization: Applied Computing Devices, Inc., Terre Haute IN
- References: <C1JMDn.9Gw@acsu.buffalo.edu>
- Date: Thu, 28 Jan 1993 22:38:30 GMT
- Lines: 17
-
- In article <C1JMDn.9Gw@acsu.buffalo.edu> zshi@acsu.buffalo.edu (Zhixin Shi) writes:
- >I use
- > system("cd ./sudir")
- >it looks like going into the subdir then come back when the program
- >finished.
-
- I assume this is under UNIX.
-
- The system() function forks a child process and the command executes
- in that process. To change the current directory within a process,
- you need to use the chdir() system call (probably in section 2 of your
- manual).
- --
- Daniel W. Johnson Applied Computing Devices, Inc.
- Home: 71520.367@CompuServe.COM Work: dwj@iedv1.acd.com
- DanielJ13@aol.com 39 25 02 N / 87 19 55 W
- - this space unintentionally left blank -
-