The Machine Perception Toolbox

[Introduction]- [News]- [Download]- [Screenshots]- [Manual (pdf)]- [Forums]- [API Reference]- [Repository ]

 

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

pwd.c

Go to the documentation of this file.
00001 #include "jam.h"
00002 #include "lists.h"
00003 #include "newstr.h"
00004 #include "pathsys.h"
00005 
00006 #include <limits.h>
00007 
00008 /* MinGW on windows declares PATH_MAX in limits.h */
00009 #if defined(NT) && ! defined(__GNUC__)
00010 #include <direct.h>
00011 #define PATH_MAX _MAX_PATH
00012 #else
00013 #include <unistd.h>
00014 #endif
00015 
00016 
00017 
00018 LIST*
00019 pwd(void)
00020 {
00021     char buffer[PATH_MAX];
00022     if (getcwd(buffer, sizeof(buffer)) == NULL)
00023     {
00024         perror("can not get current directory");
00025         return L0;
00026     }
00027     else
00028     {
00029 #ifdef NT
00030         return list_new(L0, short_path_to_long_path(buffer));
00031 #else
00032         return list_new(L0, newstr(buffer));
00033 #endif
00034     }
00035 }
00036 

Generated on Mon Nov 8 17:07:47 2004 for MPT by  doxygen 1.3.9.1