Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: mkdir -p buldtin is possibly incorrect?
- X-seq: zsh-workers 21472
- From: Alexey Tourbin <at@xxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxxxxx>
- Subject: Re: mkdir -p buldtin is possibly incorrect?
- Date: Fri, 15 Jul 2005 11:13:47 +0400
- In-reply-to: <1050714234704.ZM28626@xxxxxxxxxxxxxxxxxxxxxxx>
- Mail-followup-to: Zsh hackers list <zsh-workers@xxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <f6879d2c05071412024c9afaf9@xxxxxxxxxxxxxx> <20050714201855.7D4078630@xxxxxxxxxxxxxxxxxxxxxxxx> <1050714234704.ZM28626@xxxxxxxxxxxxxxxxxxxxxxx>
On Thu, Jul 14, 2005 at 11:47:03PM +0000, Bart Schaefer wrote:
> Won't stat() return an error on a dangling symlink and therefore make
> it appear that no file exists when in fact one does?
There seems to be no problem with this, since subsequent mkdir() call
is going to fail with EEXIST.
127 if(p) {
128 struct stat st;
129
130 if(!stat(rpath, &st) && S_ISDIR(st.st_mode))
131 return 0;
132 }
133 oumask = umask(0);
134 err = mkdir(path, mode) ? errno : 0;
135 umask(oumask);
136 if(!err)
137 return 0;
138 zwarnnam(nam, "cannot make directory `%s': %e", path, err);
139 return 1;
Attachment:
pgpwvFG9Fufbm.pgp
Description: PGP signature
Messages sorted by:
Reverse Date,
Date,
Thread,
Author