Mail Archives: djgpp/2004/10/01/06:00:37
Vyom <vyom2k4 AT yahoo DOT com> wrote:
> > You're trying too hard:
> >
> > #include <stdio.h>
> > #include <unistd.h>
> >
> > 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.
- Raw text -