Create a gist now

Instantly share code, notes, and snippets.

@eQu1NoX /test-realpath.c Secret
Created May 27, 2014

What would you like to do?
#include<stdio.h>
#include<stdlib.h>
#include<limits.h>
#include<string.h>
#include<errno.h>
int main(int argc, const char *argv[])
{
char abspath[9000];
char *ptr = realpath("./x", abspath);
if (ptr == NULL) {
printf("Unable to get abspath\n");
printf("Error - %s\n", strerror(errno));
exit(1);
}
printf("Abspath of file is - %s\n", abspath);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment