Skip to content

Instantly share code, notes, and snippets.

@lopter
Last active December 13, 2016 23:43
Show Gist options
  • Save lopter/46523aa3b7cad6bcdf28a898adbdc2f7 to your computer and use it in GitHub Desktop.
Save lopter/46523aa3b7cad6bcdf28a898adbdc2f7 to your computer and use it in GitHub Desktop.
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int
main(int argc, char *argv[])
{
if (argc != 2) {
fprintf(stderr, "Usage: %s path\n", argv[0]);
return 1;
}
char path[PATH_MAX] = { 0 };
puts(realpath(argv[1], path));
return 0;
}
@lopter
Copy link
Author

lopter commented Dec 11, 2016

For mac OS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment