Hi again,
While working on a new patch with special cases I realized that
file_name_split() can return an empty name too, namely in the case of
an existing directory with trailing slashes. This is poorly handled by
callers as well. For instance:
$ ln -T existing_file existing_dir/
ln: creatin
> However there's nothing such for the calls manipulating the links of a
> directory such as dir_mkdir(), dir_rmdir(), dir_unlink() and so on.
> These apparently return EINVAL on an empty string (or at least my
> /hurd/ext2fs does).
Well, as we've been noting here, there is not really any sensical
On Sun, Jun 13, 2010 at 11:51 AM, Roland McGrath wrote:
>> You mean directory_name_split("/") should return (, "") ?
>
> I do. "This is the same as file_name_split, but ignores trailing slashes."
> (...)
Note that my patch changes both of them to return (, "."), and
alters the documentation acco
On Sun, Jun 13, 2010 at 1:17 PM, Roland McGrath wrote:
>> Is the empty string supposed to refer to the node itself somehow?
>
> It does. To look up "." you need search (execute) permission on the
> directory. To look up "" it just has to actually be a directory port.
> At least, that's the way I
Hi Roland,
On Sun, Jun 13, 2010 at 10:53 AM, Roland McGrath wrote:
> The . bit is bogus. It should behave the same as file_name_split.
You mean directory_name_split("/") should return (, "") ?
This makes mkdir(), for instance, fail with EINVAL as well.
Should it be handled on a case-by-case ba
> Note that my patch changes both of them to return (, "."), and
> alters the documentation accordingly, though my post was unclear about
> this (sorry).
Oh, I didn't read it closely. Yeah, don't do that.
> Is the empty string supposed to refer to the node itself somehow?
It does. To look up "
Da Zheng, le Sun 13 Jun 2010 11:54:10 +0800, a écrit :
> > It is. Are you perhaps using the old K16 qemu image? There is a bug
> > with it, you need to fix the image size
>
> No, I'm not using the qemu image. Hurd runs in VMWare. But I used K16 CD to
> install Hurd. Can it be a problem?
In prin
> You mean directory_name_split("/") should return (, "") ?
I do. "This is the same as file_name_split, but ignores trailing slashes."
So directory_name_split ("") should return (crdir, "") too.
End of story.
> This makes mkdir(), for instance, fail with EINVAL as well.
Well, what should it
The . bit is bogus. It should behave the same as file_name_split.
Thanks,
Roland
Hello,
The file_name_split(const char *path, char **name) function from glibc
resolves the parent directory for 'path' into a port (which is
returned) and makes '*name' point into 'path' at the beginning of the
base name. See
http://www.gnu.org/software/hurd/hurd/glibc/hurd-specific_api.html.
Th
10 matches
Mail list logo