Re: [PATCH 1/4] is_directory(): a generic helper function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano schrieb:
> +/*
> + * Do not use this for inspecting *tracked* content.  When path is a
> + * symlink to a directory, we do not want to say it is a directory.

I though stat(2) checks the thing that a symlink points to. Then either
this comment is not correct or you want to use lstat(2), no?

> + * Worth yet, leading components in path could contain symbolic links.
> + */
> +int is_directory(const char *path)
> +{
> +	struct stat st;
> +	return (!stat(path, &st) && S_ISDIR(st.st_mode));
> +}

-- Hannes

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux