
#include <sys/stat.h>
#include <unistd.h>

int file_exists (char *file_name)
{
	struct stat stat_buffer;

	file_name+=4;
	if (stat (file_name,&stat_buffer)==0)
		if ((stat_buffer.st_mode & S_IFMT)==S_IFREG && 
			(stat_buffer.st_mode & S_IRUSR)==S_IRUSR)
			return 1;

	return 0;
}
