Project

General

Profile

realpath.c

A simple, small utiltity program proving a canonicalized absolute pathname. See realpath(3). - Randolph Herber, 08/18/2011 02:31 PM

 
1
#include <stdio.h>
2
#include <stdlib.h>
3
#include <linux/limits.h>
4

    
5
int
6
main(int argc, char **argv) {
7
  char resolved[PATH_MAX];
8
  if(argv && argv[1]) {
9
    printf("%s\n",realpath(argv[1],resolved));
10
  }
11
  return 0;
12
}