Last active

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Compile: "gcc -o main main.c" Call: "./main /path/to/some/file/or/directory"

View main.c
1 2 3 4 5 6 7 8 9 10 11 12
#include <stdio.h>
#include <unistd.h>
 
int main (int argc, char** argv) {
char* path = argv[1];
printf ("Checking write permissions for %s:\n", path);
int result = access(path, W_OK);
 
printf ("User %s have write permissions.\n", (result == -1 ? "does NOT" : "DOES"));
 
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.