X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: vyom2k4 AT yahoo DOT com (Vyom) Newsgroups: comp.os.msdos.djgpp Subject: Re: About chdir() Date: 30 Sep 2004 22:42:50 -0700 Organization: http://groups.google.com Lines: 39 Message-ID: References: <2s33rfF1gghltU1 AT uni-berlin DOT de> NNTP-Posting-Host: 203.126.136.220 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1096609371 30660 127.0.0.1 (1 Oct 2004 05:42:51 GMT) X-Complaints-To: groups-abuse AT google DOT com NNTP-Posting-Date: Fri, 1 Oct 2004 05:42:51 +0000 (UTC) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com > You're trying too hard: > > #include > #include > > int main(void) > { > char pwd[FILENAME_MAX]; > > if (chdir("d:/program files")) > perror("d:/program files"); > else > printf("No error reported from chdir.\n"); > if (getcwd(pwd, sizeof pwd)) > printf("current working directory is %s\n", pwd); > else > perror("getcwd failed."); > return 0; > } > > Thank you all, Does it mean chdir doesn't work with back slash at all or only when there are spaces? I tried running this program I got the output: No error reported from chdir. current working directory is d:/program files in command.com, but when run in cmd.exe there is no output at all, why does that happen? -- Vyom