BVB Source Codes

pyenv Show realpath.c Source code

Return Download pyenv: download realpath.c Source code - Download pyenv Source code - Type:.c
  1. #include "bash.h"
  2. #include <stdlib.h>
  3. #include <stdio.h>
  4.  
  5. int realpath_builtin(list)
  6. WORD_LIST *list;
  7. {
  8.         int es;
  9.         char *realbuf, *p;
  10.  
  11.         if (list == 0) {
  12.                 // builtin_usage();
  13.                 return (EX_USAGE);
  14.         }
  15.  
  16.         for (es = EXECUTION_SUCCESS; list; list = list->next) {
  17.                 p = list->word->word;
  18.                 realbuf = realpath(p, NULL);
  19.                 if (realbuf == NULL) {
  20.                         es = EXECUTION_FAILURE;
  21.                         // builtin_error("%s: cannot resolve: %s", p, strerror(errno));
  22.                 } else {
  23.                         printf("%s\n", realbuf);
  24.                         free(realbuf);
  25.                 }
  26.         }
  27.         return es;
  28. }
  29.  
  30. char *realpath_doc[] = {
  31.         "Display each PATHNAME argument, resolving symbolic links. The exit status",
  32.         "is 0 if each PATHNAME was resolved; non-zero otherwise.",
  33.         (char *)NULL
  34. };
  35.  
  36. struct builtin realpath_struct = {
  37.         "realpath",
  38.         realpath_builtin,
  39.         BUILTIN_ENABLED,
  40.         realpath_doc,
  41.         "realpath pathname [pathname...]",
  42.         0
  43. };
  44.  
downloadrealpath.c Source code - Download pyenv Source code
Related Source Codes/Software:
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10
django-rest-framework - Web APIs for Django. http:/... 2017-06-10
lectures - Oxford Deep NLP 2017 course 2017-06-10
algorithms - Minimal examples of data structures and algorithms... 2017-06-10
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
pyenv - Simple Python version management 2017-06-10

 Back to top