Пример #1
0
/*
 * Return non-zero if all path components of 'name' exists as a
 * directory.  If prefix_len > 0, we will test with the stat()
 * function instead of the lstat() function for a prefix length of
 * 'prefix_len', thus we then allow for symlinks in the prefix part as
 * long as those points to real existing directories.
 */
int has_dirs_only_path(const char *name, int len, int prefix_len)
{
	struct cache_def *cache = &default_cache;	/* FIXME */
	return lstat_cache(cache, name, len,
			   FL_DIR|FL_FULLPATH, prefix_len) &
		FL_DIR;
}
Пример #2
0
/*
 * Return non-zero if path 'name' has a leading symlink component or
 * if some leading path component does not exists.
 */
int has_symlink_or_noent_leading_path(const char *name, int len)
{
	struct cache_def *cache = &default_cache;	/* FIXME */
	return lstat_cache(cache, name, len,
			   FL_SYMLINK|FL_NOENT|FL_DIR, USE_ONLY_LSTAT) &
		(FL_SYMLINK|FL_NOENT);
}
Пример #3
0
/*
 * Return non-zero if all path components of 'name' exists as a
 * directory.  If prefix_len > 0, we will test with the stat()
 * function instead of the lstat() function for a prefix length of
 * 'prefix_len', thus we then allow for symlinks in the prefix part as
 * long as those points to real existing directories.
 */
int has_dirs_only_path(const char *name, int len, int prefix_len)
{
	return lstat_cache(name, len,
			   FL_DIR|FL_FULLPATH, prefix_len) &
		FL_DIR;
}
Пример #4
0
/*
 * Return non-zero if path 'name' has a leading symlink component or
 * if some leading path component does not exists.
 */
int has_symlink_or_noent_leading_path(const char *name, int len)
{
	return lstat_cache(name, len,
			   FL_SYMLINK|FL_NOENT|FL_DIR, USE_ONLY_LSTAT) &
		(FL_SYMLINK|FL_NOENT);
}
Пример #5
0
/*
 * Return non-zero if path 'name' has a leading symlink component
 */
int has_symlink_leading_path(const char *name, int len)
{
	return lstat_cache(name, len,
			   FL_SYMLINK|FL_DIR, USE_ONLY_LSTAT) &
		FL_SYMLINK;
}
Пример #6
0
/*
 * Return non-zero if all path components of 'name' exists as a
 * directory.  If prefix_len > 0, we will test with the stat()
 * function instead of the lstat() function for a prefix length of
 * 'prefix_len', thus we then allow for symlinks in the prefix part as
 * long as those points to real existing directories.
 */
static int threaded_has_dirs_only_path(struct cache_def *cache, const char *name, int len, int prefix_len)
{
	return lstat_cache(cache, name, len,
			   FL_DIR|FL_FULLPATH, prefix_len) &
		FL_DIR;
}
Пример #7
0
/*
 * Return non-zero if path 'name' has a leading symlink component
 */
int threaded_has_symlink_leading_path(struct cache_def *cache, const char *name, int len)
{
	return lstat_cache(cache, name, len, FL_SYMLINK|FL_DIR, USE_ONLY_LSTAT) & FL_SYMLINK;
}