Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
13 lines (11 sloc) 280 Bytes
#include <sys/stat.h>
#include <stdio.h>
int main() {
struct stat buf;
stat("test.c", &buf);
fprintf(stderr, "owned by %d:%d\n", buf.st_uid, buf.st_gid);
chown("test.c", 0, 0);
stat("test.c", &buf);
fprintf(stderr, "owned by %d:%d\n", buf.st_uid, buf.st_gid);
return 0;
}
Something went wrong with that request. Please try again.