fileis -> scrut after consultation with emma

This commit is contained in:
2023-12-20 22:55:17 -07:00
parent b4dfd1c546
commit 745c653366
5 changed files with 7 additions and 12 deletions
-7
View File
@@ -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
View 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 c;
int (*f)(char *path);
if(argc < 2)
goto usage;
while((c = getopt(argc, argv, "erwx")) != -1)
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;
}