Author: ambs
Date: Tue Jan 10 12:29:05 2006
New Revision: 11055
Modified:
trunk/src/classes/os.pmc
Log:
os.pmc - changed functions for windows from _chdir to chdir, and others.
Modified: trunk/src/classes/os.pmc
==============================================================================
--- trunk/src/classes/os.pmc (original)
+++ trunk/src/classes/os.pmc Tue Jan 10 12:29:05 2006
@@ -61,15 +61,11 @@ 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));
@@ -95,11 +91,7 @@ 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);
@@ -128,11 +120,7 @@ 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);
@@ -163,7 +151,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