1
/* $Id: access.c 61 2006-05-19 18:32:14Z steve-beattie $ */
4
* Copyright (C) 2002-2005 Novell/SUSE
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License as
8
* published by the Free Software Foundation, version 2 of the
15
#include <sys/types.h>
20
int main(int argc, char *argv[])
23
char *path, *perm, *tmp;
26
fprintf(stderr, "usage: %s path mode\n",
38
case 'r': mode |= R_OK; break;
39
case 'w': mode |= W_OK; break;
40
case 'x': mode |= X_OK; break;
41
default: fprintf(stderr, "Invalid perm '%c'\n",
49
rc=access(path, mode);
51
fprintf(stderr, "FAIL: access %s %s failed - %s\n",
52
path, perm, strerror(errno));