Re: How does "cd" command work?
From: Heiko Jappe (hej_at_gis.de)
Date: 10/22/03
- Next message: Loic Domaigne: "Re: automake 1.6.3 running on RH 9.0 using GCC 3.2.2"
- Previous message: Måns Rullgård: "Re: How does "cd" command work?"
- In reply to: J Peterman: "Re: How does "cd" command work?"
- Next in thread: Fletcher Glenn: "Re: How does "cd" command work?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 22 Oct 2003 09:34:45 GMT
J Peterman <J@Nospam.please> writes:
>Is there a command that will check whether a path is valid or not?
Yes, chdir() return -1 on error -- check the "errno" value like
this:
if (chdir(path) == -1) {
fprintf(stderr, "%s: %s\n", path, strerror(errno))
do_what_ever_you_want();
}
Heiko
- Next message: Loic Domaigne: "Re: automake 1.6.3 running on RH 9.0 using GCC 3.2.2"
- Previous message: Måns Rullgård: "Re: How does "cd" command work?"
- In reply to: J Peterman: "Re: How does "cd" command work?"
- Next in thread: Fletcher Glenn: "Re: How does "cd" command work?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]