comparison lib/functions.c @ 51:63edd4de94dd

Add xaccess()
author Rob Landley <rob@landley.net>
date Mon, 08 Jan 2007 03:25:47 -0500
parents 63c168b65fa6
children ba561c21ea27
comparison
equal deleted inserted replaced
50:63c168b65fa6 51:63edd4de94dd
136 void xexec(char **argv) 136 void xexec(char **argv)
137 { 137 {
138 toy_exec(argv); 138 toy_exec(argv);
139 execvp(argv[0], argv); 139 execvp(argv[0], argv);
140 error_exit("No %s", argv[0]); 140 error_exit("No %s", argv[0]);
141 }
142
143 void xaccess(char *path, int flags)
144 {
145 if (access(path, flags)) error_exit("Can't access '%s'\n", path);
141 } 146 }
142 147
143 // Die unless we can open/create a file, returning file descriptor. 148 // Die unless we can open/create a file, returning file descriptor.
144 int xcreate(char *path, int flags, int mode) 149 int xcreate(char *path, int flags, int mode)
145 { 150 {