X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Hans-Bernhard Broeker Newsgroups: comp.os.msdos.djgpp Subject: Re: About chdir() Date: 1 Oct 2004 09:46:56 GMT Lines: 37 Message-ID: <2s4ncgF1gobiaU1@uni-berlin.de> References: <2s33rfF1gghltU1 AT uni-berlin DOT de> X-Trace: news.uni-berlin.de MfW+w4AjBsmouIyIAlLTxgCafp1bPSImuxGjBjE0STwxCF8FGDPCO+ilyA X-Orig-Path: not-for-mail To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Vyom wrote: > > 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? None of those. As I wrote before chdir("d:\\program files"); should work just as nicely. -- Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.