Author: ambs
Date: Tue Jan 10 13:44:26 2006
New Revision: 11064

Modified:
   trunk/src/classes/os.pmc
Log:
os.pmc - added _ again under windows functions.


Modified: trunk/src/classes/os.pmc
==============================================================================
--- trunk/src/classes/os.pmc    (original)
+++ trunk/src/classes/os.pmc    Tue Jan 10 13:44:26 2006
@@ -61,11 +61,15 @@ Returns the current working directory.
 
     METHOD STRING* cwd() {
         char * cwd;
+#ifdef WIN32
+        cwd = _getcwd(NULL, 0);
+#else
 #ifdef PATH_MAX
         cwd = getcwd(NULL, PATH_MAX+1);
 #else 
         cwd = getcwd(NULL, 0);
 #endif
+#endif
         if (cwd) {
             STRING *scwd;
             scwd = string_from_cstring(interpreter, cwd, strlen(cwd));
@@ -91,7 +95,11 @@ Changes the current working directory to
     METHOD void chdir(STRING *path) {
         int error;
         char *cpath = string_to_cstring(interpreter, path);
+#ifdef WIN32
         error = chdir(cpath);
+#else
+        error = _chdir(cpath);
+#endif
         string_cstring_free(cpath);
         if (error) {
             char *errmsg = strerror(errno);
@@ -120,7 +128,11 @@ C<path>.
         }
 
         if (S_ISDIR(info.st_mode)) {
+#ifdef WIN32
+            error = _rmdir(cpath);
+#else
             error = rmdir(cpath);
+#endif
             string_cstring_free(cpath);
             if (error) {
                 char *errmsg = strerror(errno);
@@ -151,7 +163,7 @@ Creates a directory specified by C<path>
         char *cpath = string_to_cstring(interpreter, path);
         /* should we validate mode? */
 #ifdef WIN32
-        error = mkdir(cpath);
+        error = _mkdir(cpath);
 #else
         error = mkdir(cpath, mode);
 #endif

Reply via email to