aboutsummaryrefslogtreecommitdiffstats
path: root/sdk/other/isftype.c
blob: bee42ca545a19d15385fdd39af5e971075127af1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
 * File type testing routine.
 * $Id$
 * Copyright (c) 1997 by Tycho Softworks.
 * For conditions of distribution and reuse see product license.
 */

#include <std/files.h>

bool	isftype(const char *path, int ftype)
{
	struct		stat ino;

	if(stat(path, &ino))
		return FALSE;

	if((ino.st_mode & S_IFMT) == ftype)
		return TRUE;

	return FALSE;
}