fileis -> scrut after consultation with emma
This commit is contained in:
parent
b4dfd1c546
commit
745c653366
@ -1,7 +0,0 @@
|
|||||||
fileis: fileis.o libfileis.o
|
|
||||||
$(CC) $(CFLAGS) -o fileis fileis.o libfileis.o
|
|
||||||
|
|
||||||
clean:
|
|
||||||
$(RM) fileis fileis.o libfileis.o
|
|
||||||
|
|
||||||
.PHONY: clean
|
|
7
wip/scrut/Makefile
Normal file
7
wip/scrut/Makefile
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
scrut: scrut.o libscrut.o
|
||||||
|
$(CC) $(CFLAGS) -o scrut scrut.o scrut.o
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(RM) scrut *.o
|
||||||
|
|
||||||
|
.PHONY: clean
|
@ -10,17 +10,12 @@ static char *program_name = "fileis";
|
|||||||
|
|
||||||
int main(int argc, char *argv[]){
|
int main(int argc, char *argv[]){
|
||||||
int c;
|
int c;
|
||||||
int (*f)(char *path);
|
|
||||||
|
|
||||||
if(argc < 2)
|
if(argc < 2)
|
||||||
goto usage;
|
goto usage;
|
||||||
|
|
||||||
while((c = getopt(argc, argv, "erwx")) != -1)
|
while((c = getopt(argc, argv, "erwx")) != -1)
|
||||||
switch(c){
|
switch(c){
|
||||||
case 'e': f = f_exists; break;
|
|
||||||
case 'r': f = f_readable; break;
|
|
||||||
case 'w': f = f_writeable; break;
|
|
||||||
case 'x': f = f_executable; break;
|
|
||||||
default: goto usage;
|
default: goto usage;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user